home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / gnustuff / tos / bison / bisn119s.zoo / texinfo.tex < prev    next >
Encoding:
Text File  |  1992-09-26  |  116.2 KB  |  3,650 lines

  1. %% TeX macros to handle texinfo files
  2.  
  3. %   Copyright (C) 1985, 86, 88, 90, 91, 92 Free Software Foundation, Inc.
  4.  
  5. %This texinfo.tex file is free software; you can redistribute it and/or
  6. %modify it under the terms of the GNU General Public License as
  7. %published by the Free Software Foundation; either version 2, or (at
  8. %your option) any later version.
  9.  
  10. %This texinfo.tex file is distributed in the hope that it will be
  11. %useful, but WITHOUT ANY WARRANTY; without even the implied warranty
  12. %of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  13. %General Public License for more details.
  14.  
  15. %You should have received a copy of the GNU General Public License
  16. %along with this texinfo.tex file; see the file COPYING.  If not, write
  17. %to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139,
  18. %USA.
  19.  
  20.  
  21. %In other words, you are welcome to use, share and improve this program.
  22. %You are forbidden to forbid anyone else to use, share and improve
  23. %what you give them.   Help stamp out software-hoarding!
  24.  
  25. \def\texinfoversion{2.85}
  26. \message{Loading texinfo package [Version \texinfoversion]:}
  27. \message{}
  28.  
  29. % Print the version number if in a .fmt file.
  30. \everyjob{\message{[Texinfo version \texinfoversion]}\message{}}
  31.  
  32. % Save some parts of plain tex whose names we will redefine.
  33.  
  34. \let\ptexlbrace=\{
  35. \let\ptexrbrace=\}
  36. \let\ptexdots=\dots
  37. \let\ptexdot=\.
  38. \let\ptexstar=\*
  39. \let\ptexend=\end
  40. \let\ptexbullet=\bullet
  41. \let\ptexb=\b
  42. \let\ptexc=\c
  43. \let\ptexi=\i
  44. \let\ptext=\t
  45. \let\ptexl=\l
  46. \let\ptexL=\L
  47.  
  48. \def\tie{\penalty 10000\ }     % Save plain tex definition of ~.
  49.  
  50. \message{Basics,}
  51. \chardef\other=12
  52.  
  53. % If this character appears in an error message or help string, it
  54. % starts a new line in the output.
  55. \newlinechar = `^^J
  56.  
  57. % Ignore a token.
  58. \def\gobble#1{}
  59.  
  60. \hyphenation{ap-pen-dix}
  61. \hyphenation{mini-buf-fer mini-buf-fers}
  62. \hyphenation{eshell}
  63.  
  64. % Margin to add to right of even pages, to left of odd pages.
  65. \newdimen \bindingoffset  \bindingoffset=0pt
  66. \newdimen \normaloffset   \normaloffset=\hoffset
  67. \newdimen\pagewidth \newdimen\pageheight
  68. \pagewidth=\hsize \pageheight=\vsize
  69.  
  70. % Sometimes it is convenient to have everything in the transcript file
  71. % and nothing on the terminal.  We don't just call \tracingall here,
  72. % since that produces some useless output on the terminal.
  73. %
  74. \def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}%
  75. \def\loggingall{\tracingcommands2 \tracingstats2 
  76.    \tracingpages1 \tracingoutput1 \tracinglostchars1 
  77.    \tracingmacros2 \tracingparagraphs1 \tracingrestores1 
  78.    \showboxbreadth\maxdimen\showboxdepth\maxdimen
  79. }%
  80.  
  81. %---------------------Begin change-----------------------
  82. %
  83. %%%% For @cropmarks command.
  84. % Dimensions to add cropmarks at corners Added by P. A. MacKay, 12 Nov. 1986
  85. %
  86. \newdimen\cornerlong \newdimen\cornerthick
  87. \newdimen \topandbottommargin
  88. \newdimen \outerhsize \newdimen \outervsize
  89. \cornerlong=1pc\cornerthick=.3pt    % These set size of cropmarks
  90. \outerhsize=7in
  91. %\outervsize=9.5in
  92. % Alternative @smallbook page size is 9.25in
  93. \outervsize=9.25in
  94. \topandbottommargin=.75in
  95. %
  96. %---------------------End change-----------------------
  97.  
  98. % \onepageout takes a vbox as an argument.  Note that \pagecontents
  99. % does insertions itself, but you have to call it yourself.
  100. \chardef\PAGE=255  \output={\onepageout{\pagecontents\PAGE}}
  101. \def\onepageout#1{\hoffset=\normaloffset
  102. \ifodd\pageno  \advance\hoffset by \bindingoffset
  103. \else \advance\hoffset by -\bindingoffset\fi
  104. {\escapechar=`\\\relax % makes sure backslash is used in output files.
  105. \shipout\vbox{{\let\hsize=\pagewidth \makeheadline} \pagebody{#1}%
  106. {\let\hsize=\pagewidth \makefootline}}}%
  107. \advancepageno \ifnum\outputpenalty>-20000 \else\dosupereject\fi}
  108.  
  109. %%%% For @cropmarks command %%%%
  110.  
  111. % Here is a modification of the main output routine for Near East Publications
  112. % This provides right-angle cropmarks at all four corners.
  113. % The contents of the page are centerlined into the cropmarks,
  114. % and any desired binding offset is added as an \hskip on either
  115. % site of the centerlined box.  (P. A. MacKay, 12 November, 1986)
  116. %
  117. \def\croppageout#1{\hoffset=0pt % make sure this doesn't mess things up
  118.          \shipout
  119.          \vbox to \outervsize{\hsize=\outerhsize
  120.                  \vbox{\line{\ewtop\hfill\ewtop}}
  121.                  \nointerlineskip
  122.                  \line{\vbox{\moveleft\cornerthick\nstop}
  123.                        \hfill
  124.                        \vbox{\moveright\cornerthick\nstop}}
  125.                  \vskip \topandbottommargin
  126.                  \centerline{\ifodd\pageno\hskip\bindingoffset\fi
  127.             \vbox{
  128.             {\let\hsize=\pagewidth \makeheadline}
  129.             \pagebody{#1}
  130.             {\let\hsize=\pagewidth \makefootline}}
  131.             \ifodd\pageno\else\hskip\bindingoffset\fi}
  132.          \vskip \topandbottommargin plus1fill minus1fill
  133.                  \boxmaxdepth\cornerthick
  134.                  \line{\vbox{\moveleft\cornerthick\nsbot}
  135.                        \hfill
  136.                        \vbox{\moveright\cornerthick\nsbot}}
  137.                  \nointerlineskip
  138.                  \vbox{\line{\ewbot\hfill\ewbot}}
  139.     }
  140.   \advancepageno 
  141.   \ifnum\outputpenalty>-20000 \else\dosupereject\fi}
  142. %
  143. % Do @cropmarks to get crop marks
  144. \def\cropmarks{\let\onepageout=\croppageout }
  145.  
  146. \def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}}
  147. {\catcode`\@ =11
  148. \gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi
  149. \dimen@=\dp#1 \unvbox#1
  150. \ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi
  151. \ifr@ggedbottom \kern-\dimen@ \vfil \fi}
  152. }
  153.  
  154. %
  155. % Here are the rules for the cropmarks.  Note that they are
  156. % offset so that the space between them is truly \outerhsize or \outervsize
  157. % (P. A. MacKay, 12 November, 1986)
  158. %
  159. \def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong}
  160. \def\nstop{\vbox
  161.   {\hrule height\cornerthick depth\cornerlong width\cornerthick}}
  162. \def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong}
  163. \def\nsbot{\vbox
  164.   {\hrule height\cornerlong depth\cornerthick width\cornerthick}}
  165.  
  166. % Parse an argument, then pass it to #1.  The argument is the rest of
  167. % the input line (except we remove a trailing comment).  #1 should be a
  168. % macro which expects an ordinary undelimited TeX argument.
  169. %
  170. \def\parsearg#1{%
  171.   \let\next = #1%
  172.   \begingroup
  173.     \obeylines
  174.     \futurelet\temp\parseargx
  175. }
  176.  
  177. % If the next token is an obeyed space (from an @example environment or
  178. % the like), remove it and recurse.  Otherwise, we're done.
  179. \def\parseargx{%
  180.   \ifx\obeyedspace\temp
  181.     \expandafter\parseargdiscardspace
  182.   \else
  183.     \expandafter\parseargline
  184.   \fi
  185. }
  186.  
  187. % Remove a single space (as the delimiter token to the macro call).
  188. {\obeyspaces %
  189.  \gdef\parseargdiscardspace {\futurelet\temp\parseargx}}
  190.  
  191. \gdef\obeyedspace{\ }
  192.  
  193. {\obeylines %
  194.   \gdef\parseargline#1^^M{%
  195.     \endgroup % End of the group started in \parsearg.
  196.     %
  197.     % First remove any @c comment, then any @comment.
  198.     % Result of each macro is put in \toks0.
  199.     \argremovec #1\c\relax %
  200.     \expandafter\argremovecomment \the\toks0 \comment\relax %
  201.     %
  202.     % Call the caller's macro, saved as \next in \parsearg.
  203.     \expandafter\next\expandafter{\the\toks0}%
  204.   }%
  205. }
  206.  
  207. % Since all \c{,omment} does is throw away the argument, we can let TeX
  208. % do that for us.  The \relax here is matched by the \relax in the call
  209. % in \parseargline; it could be more or less anything, its purpose is
  210. % just to delimit the argument to the \c.
  211. \def\argremovec#1\c#2\relax{\toks0 = {#1}}
  212. \def\argremovecomment#1\comment#2\relax{\toks0 = {#1}}
  213.  
  214. % \argremovec{,omment} might leave us with trailing spaces, though; e.g.,
  215. %    @end itemize  @c foo
  216. % will have two active spaces as part of the argument with the
  217. % `itemize'.  Here we remove all active spaces from #1, and assign the
  218. % result to \toks0.
  219. %
  220. % This loses if there are any *other* active characters besides spaces
  221. % in the argument -- _ ^ +, for example -- since they get expanded.
  222. % Fortunately, Texinfo does not define any such commands.  (If it ever
  223. % does, the catcode of the characters in questionwill have to be changed
  224. % here.)  But this means we cannot call \removeactivespaces as part of
  225. % \argremovec{,omment}, since @c uses \parsearg, and thus the argument
  226. % that \parsearg gets might well have any character at all in it.
  227. \def\removeactivespaces#1{%
  228.   \begingroup
  229.     \ignoreactivespaces
  230.     \edef\temp{#1}%
  231.     \global\toks0 = \expandafter{\temp}%
  232.   \endgroup
  233. }
  234.  
  235. % Change the active space to expand to nothing.
  236. \begingroup
  237.   \obeyspaces
  238.   \gdef\ignoreactivespaces{\obeyspaces\let =\empty}
  239. \endgroup
  240.  
  241.  
  242. \def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next}
  243.  
  244. %% These are used to keep @begin/@end levels from running away
  245. %% Call \inENV within environments (after a \begingroup)
  246. \newif\ifENV \ENVfalse \def\inENV{\ifENV\relax\else\ENVtrue\fi}
  247. \def\ENVcheck{%
  248. \ifENV\errmessage{Still within an environment.  Type Return to continue.}
  249. \endgroup\fi} % This is not perfect, but it should reduce lossage
  250.  
  251. % @begin foo  is the same as @foo, for now.
  252. \newhelp\EMsimple{Type <Return> to continue.}
  253.  
  254. \outer\def\begin{\parsearg\beginxxx}
  255.  
  256. \def\beginxxx #1{%
  257. \expandafter\ifx\csname #1\endcsname\relax
  258. {\errhelp=\EMsimple \errmessage{Undefined command @begin #1}}\else
  259. \csname #1\endcsname\fi}
  260.  
  261. % @end foo executes the definition of \Efoo.
  262. %
  263. \def\end{\parsearg\endxxx}
  264. \def\endxxx #1{%
  265.   \removeactivespaces{#1}%
  266.   \edef\endthing{\the\toks0}%
  267.   %
  268.   \expandafter\ifx\csname E\endthing\endcsname\relax
  269.     \expandafter\ifx\csname \endthing\endcsname\relax
  270.       % There's no \foo, i.e., no ``environment'' foo.
  271.       \errhelp = \EMsimple
  272.       \errmessage{Undefined command `@end \endthing'}%
  273.     \else
  274.       % There is an environment foo, but it hasn't been started.
  275.       \errhelp = \EMsimple
  276.       \errmessage{This `@end \endthing' doesn't have a matching `@\endthing'}%
  277.     \fi
  278.   \else
  279.     % Everything's ok; the right environment has been started.
  280.     \csname E\endthing\endcsname
  281.   \fi
  282. }
  283.  
  284.  
  285. % Single-spacing is done by various environments.
  286.  
  287. \newskip\singlespaceskip \singlespaceskip = \baselineskip
  288. \def\singlespace{%
  289. {\advance \baselineskip by -\singlespaceskip
  290. \kern \baselineskip}%
  291. \baselineskip=\singlespaceskip
  292. }
  293.  
  294. %% Simple single-character @ commands
  295.  
  296. % @@ prints an @
  297. % Kludge this until the fonts are right (grr).
  298. \def\@{{\tt \char '100}}
  299.  
  300. % This is turned off because it was never documented
  301. % and you can use @w{...} around a quote to suppress ligatures.
  302. %% Define @` and @' to be the same as ` and '
  303. %% but suppressing ligatures.
  304. %\def\`{{`}}
  305. %\def\'{{'}}
  306.  
  307. % Used to generate quoted braces.
  308.  
  309. \def\mylbrace {{\tt \char '173}}
  310. \def\myrbrace {{\tt \char '175}}
  311. \let\{=\mylbrace
  312. \let\}=\myrbrace
  313.  
  314. % @: forces normal size whitespace following.
  315. \def\:{\spacefactor=1000 }
  316.  
  317. % @* forces a line break.
  318. \def\*{\hfil\break\hbox{}\ignorespaces}
  319.  
  320. % @. is an end-of-sentence period.
  321. \def\.{.\spacefactor=3000 }
  322.  
  323. % @w prevents a word break.  Without the \leavevmode, @w at the
  324. % beginning of a paragraph, when TeX is still in vertical mode, would
  325. % produce a whole line of output instead of starting the paragraph.
  326. \def\w#1{\leavevmode\hbox{#1}}
  327.  
  328. % @group ... @end group forces ... to be all on one page, by enclosing
  329. % it in a TeX vbox.  We use \vtop instead of \vbox to construct the box
  330. % to keep its height that of a normal line.  According to the rules for
  331. % \topskip (p.114 of the TeXbook), the glue inserted is
  332. % max (\topskip - \ht (first item), 0).  If that height is large,
  333. % therefore, no glue is inserted, and the space between the headline and
  334. % the text is small, which looks bad.
  335. \def\group{\begingroup
  336.   \ifnum\catcode13=\active \else
  337.     \errhelp = \groupinvalidhelp
  338.     \errmessage{@group invalid in context where filling is enabled}%
  339.   \fi
  340.   %
  341.   % If we don't do the \strut ... \nointerlineskip, we wind up with a
  342.   % box with a large depth, and hence get (typically) \lineskip leading
  343.   % (1pt), instead of the usual interline space (\baselineskip).  See
  344.   % p.82 of the TeXbook.
  345.   \def\Egroup{%
  346.     \strut            % Put in the normal leading.
  347.     \egroup           % End the \vtop.
  348.     \endgroup         % End the \group.
  349.     \nointerlineskip  % We inserted our own leading.
  350.   }%
  351.   %
  352.   \vtop\bgroup
  353.     % We do @comment here in case we are called inside an environment,
  354.     % such as @example, where each end-of-line in the input causes an
  355.     % end-of-line in the output.  We don't want the end-of-line after
  356.     % the `@group' to put extra space in the output.  Since @group
  357.     % should appear on a line by itself (according to the Texinfo
  358.     % manual), we don't worry about eating any user text.
  359.     \comment
  360. }
  361. %
  362. % TeX puts in an \escapechar (i.e., `@') at the beginning of the help
  363. % message, so this ends up printing `@group can only ...'.
  364. \newhelp\groupinvalidhelp{%
  365. group can only be used in environments such as @example,^^J%
  366. where each line of input produces a line of output.}
  367.  
  368. % @need space-in-mils
  369. % forces a page break if there is not space-in-mils remaining.
  370.  
  371. \newdimen\mil  \mil=0.001in
  372.  
  373. \def\need{\parsearg\needx}
  374.  
  375. % Old definition--didn't work.
  376. %\def\needx #1{\par %
  377. %% This method tries to make TeX break the page naturally
  378. %% if the depth of the box does not fit.
  379. %{\baselineskip=0pt%
  380. %\vtop to #1\mil{\vfil}\kern -#1\mil\penalty 10000
  381. %\prevdepth=-1000pt
  382. %}}
  383.  
  384. \def\needx#1{%
  385.   % Go into vertical mode, so we don't make a big box in the middle of a
  386.   % paragraph.
  387.   \par
  388.   %
  389.   % Don't add any leading before our big empty box, but allow a page
  390.   % break, since the best break might be right here.
  391.   \allowbreak
  392.   \nointerlineskip
  393.   \vtop to #1\mil{\vfil}%
  394.   % 
  395.   % TeX does not even consider page breaks if a penalty added to the
  396.   % main vertical list is 10000 or more.  But in order to see if the
  397.   % empty box we just added fits on the page, we must make it consider
  398.   % page breaks.  On the other hand, we don't want to actually break the
  399.   % page after the empty box.  So we use a penalty of 9999.
  400.   % 
  401.   % There is an extremely small chance that TeX will actually break the
  402.   % page at this \penalty, if there are no other feasible breakpoints in
  403.   % sight.  (If the user is using lots of big @group commands, which
  404.   % almost-but-not-quite fill up a page, TeX will have a hard time doing
  405.   % good page breaking, for example.)  However, I could not construct an
  406.   % example where a page broke at this \penalty; if it happens in a real
  407.   % document, then we can reconsider our strategy.
  408.   \penalty9999
  409.   %
  410.   % Back up by the size of the box, whether we did a page break or not.
  411.   \kern -#1\mil
  412.   %
  413.   % Do not allow a page break right after this kern.
  414.   \nobreak
  415. }
  416.  
  417. % @br   forces paragraph break
  418.  
  419. \let\br = \par
  420.  
  421. % @dots{}  output some dots
  422.  
  423. \def\dots{$\ldots$}
  424.  
  425. % @page    forces the start of a new page
  426.  
  427. \def\page{\par\vfill\supereject}
  428.  
  429. % @exdent text....
  430. % outputs text on separate line in roman font, starting at standard page margin
  431.  
  432. % This records the amount of indent in the innermost environment.
  433. % That's how much \exdent should take out.
  434. \newskip\exdentamount
  435.  
  436. % This defn is used inside fill environments such as @defun.
  437. \def\exdent{\parsearg\exdentyyy}
  438. \def\exdentyyy #1{{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break}}
  439.  
  440. % This defn is used inside nofill environments such as @example.
  441. \def\nofillexdent{\parsearg\nofillexdentyyy}
  442. \def\nofillexdentyyy #1{{\advance \leftskip by -\exdentamount
  443. \leftline{\hskip\leftskip{\rm#1}}}}
  444.  
  445. %\hbox{{\rm#1}}\hfil\break}}
  446.  
  447. % @include file    insert text of that file as input.
  448.  
  449. \def\include{\parsearg\includezzz}
  450. \def\includezzz #1{{\def\thisfile{#1}\input #1
  451. }}
  452.  
  453. \def\thisfile{}
  454.  
  455. % @center line   outputs that line, centered
  456.  
  457. \def\center{\parsearg\centerzzz}
  458. \def\centerzzz #1{{\advance\hsize by -\leftskip
  459. \advance\hsize by -\rightskip
  460. \centerline{#1}}}
  461.  
  462. % @sp n   outputs n lines of vertical space
  463.  
  464. \def\sp{\parsearg\spxxx}
  465. \def\spxxx #1{\par \vskip #1\baselineskip}
  466.  
  467. % @comment ...line which is ignored...
  468. % @c is the same as @comment
  469. % @ignore ... @end ignore  is another way to write a comment
  470.  
  471. \def\comment{\catcode 64=\other \catcode 123=\other \catcode 125=\other%
  472. \parsearg \commentxxx}
  473.  
  474. \def\commentxxx #1{\catcode 64=0 \catcode 123=1 \catcode 125=2 }
  475.  
  476. \let\c=\comment
  477.  
  478. % Prevent errors for section commands.
  479. % Used in @ignore and in failing conditionals.
  480. \def\ignoresections{%
  481. \let\chapter=\relax
  482. \let\unnumbered=\relax
  483. \let\top=\relax
  484. \let\unnumberedsec=\relax
  485. \let\unnumberedsection=\relax
  486. \let\unnumberedsubsec=\relax
  487. \let\unnumberedsubsection=\relax
  488. \let\unnumberedsubsubsec=\relax
  489. \let\unnumberedsubsubsection=\relax
  490. \let\section=\relax
  491. \let\subsec=\relax
  492. \let\subsubsec=\relax
  493. \let\subsection=\relax
  494. \let\subsubsection=\relax
  495. \let\appendix=\relax
  496. \let\appendixsec=\relax
  497. \let\appendixsection=\relax
  498. \let\appendixsubsec=\relax
  499. \let\appendixsubsection=\relax
  500. \let\appendixsubsubsec=\relax
  501. \let\appendixsubsubsection=\relax
  502. \let\contents=\relax
  503. \let\smallbook=\relax
  504. \let\titlepage=\relax
  505. }
  506.  
  507. % Ignore @ignore ... @end ignore.
  508. \def\ignore{\doignore{ignore}}
  509.  
  510. % We ignore @ifinfo text.
  511. \def\ifinfo{\doignore{ifinfo}}
  512.  
  513. % Ignore text until a line `@end #1'.
  514. \def\doignore#1{\begingroup
  515.   % Don't complain about control sequences we have declared \outer.
  516.   \ignoresections
  517.   %
  518.   % Define a command to swallow text until we reach `@end #1'.
  519.   \long\def\doignoretext##1\end #1{\enddoignore}%
  520.   %
  521.   % Make sure that spaces turn into tokens that match what \doignoretext wants.
  522.   \catcode32 = 10
  523.   %
  524.   % And now expand that command.
  525.   \doignoretext
  526. }
  527.  
  528. % What we do to finish off ignored text.
  529. \def\enddoignore{\endgroup\ignorespaces}%
  530.  
  531. \def\direntry{\begingroup\direntryxxx}
  532. \long\def\direntryxxx #1\end direntry{\endgroup\ignorespaces}
  533.  
  534. % Conditionals to test whether a flag is set.
  535.  
  536. \def\ifset{\begingroup\ignoresections\parsearg\ifsetxxx}
  537.  
  538. \def\ifsetxxx #1{\endgroup
  539. \expandafter\ifx\csname SET#1\endcsname\relax \let\temp=\ifsetfail
  540. \else \let\temp=\relax \fi
  541. \temp}
  542. \def\Eifset{}
  543. \def\ifsetfail{\doignore{ifset}}
  544.  
  545. \def\ifclear{\begingroup\ignoresections\parsearg\ifclearxxx}
  546.  
  547. \def\ifclearxxx #1{\endgroup
  548. \expandafter\ifx\csname SET#1\endcsname\relax \let\temp=\relax
  549. \else \let\temp=\ifclearfail \fi
  550. \temp}
  551. \def\Eifclear{}
  552. \def\ifclearfail{\doignore{ifclear}}
  553.  
  554. % @set foo
  555. %       to set the flag named foo to a default value (empty)
  556. % @set foo REST-OF-LINE
  557. %    to set the flag named foo to a text string REST-OF-LINE
  558. % @clear foo   to clear the flag named foo.
  559. % @value{foo} to set the text saved in foo
  560. %
  561. % @set command, work macro \setyyy
  562. %
  563. \def\setyyy#1 #2\endsetyyy{\expandafter\xdef\csname SET#1\endcsname{#2\unskip}}
  564. %
  565. \def\setxxx#1{\setyyy#1 \endsetyyy}
  566. \def\set{\parsearg\setxxx}
  567.  
  568. \def\clear{\parsearg\clearxxx}
  569. \def\clearxxx #1{
  570. \expandafter\let\csname SET#1\endcsname=\relax}
  571.  
  572. \def\value#1{\expandafter
  573.         \ifx\csname SET#1\endcsname\relax
  574.             {\{No value for ``#1''\}}
  575.         \else \csname SET#1\endcsname \fi}
  576.  
  577. % Some texinfo constructs that are trivial in tex
  578.  
  579. \def\iftex{}
  580. \def\Eiftex{}
  581.  
  582. \long\def\menu #1\end menu{}
  583. \def\asis#1{#1}
  584.  
  585. % @math means output in math mode.
  586. % We don't use $'s directly in the definition of \math because control
  587. % sequences like \math are expanded when the toc file is written.  Then,
  588. % we read the toc file back, the $'s will be normal characters (as they
  589. % should be, according to the definition of Texinfo).  So we must use a
  590. % control sequence to switch into and out of math mode.
  591. % This isn't quite enough for @math to work properly in indices, but it
  592. % seems unlikely it will ever be needed there.
  593. \let\implicitmath = $
  594. \def\math#1{\implicitmath #1\implicitmath}
  595.  
  596. \def\node{\ENVcheck\parsearg\nodezzz}
  597. \def\nodezzz#1{\nodexxx [#1,]}
  598. \def\nodexxx[#1,#2]{\gdef\lastnode{#1}}
  599. \let\lastnode=\relax
  600.  
  601. \def\donoderef{\ifx\lastnode\relax\else
  602. \expandafter\expandafter\expandafter\setref{\lastnode}\fi
  603. \let\lastnode=\relax}
  604.  
  605. \def\unnumbnoderef{\ifx\lastnode\relax\else
  606. \expandafter\expandafter\expandafter\unnumbsetref{\lastnode}\fi
  607. \let\lastnode=\relax}
  608.  
  609. \def\appendixnoderef{\ifx\lastnode\relax\else
  610. \expandafter\expandafter\expandafter\appendixsetref{\lastnode}\fi
  611. \let\lastnode=\relax}
  612.  
  613. \let\refill=\relax
  614.   
  615. % @setfilename is done at the beginning of every texinfo file.
  616. % So open here the files we need to have open while reading the input.
  617. % This makes it possible to make a .fmt file for texinfo.
  618. \def\setfilename{%
  619.    \readauxfile
  620.    \opencontents
  621.    \openindices
  622.    \fixbackslash  % Turn off hack to swallow `\input texinfo'.
  623.    \global\let\setfilename=\comment % Ignore extra @setfilename cmds.
  624.    \comment % Ignore the actual filename.
  625. }
  626.  
  627. \outer\def\bye{\pagealignmacro\tracingstats=1\ptexend}
  628.  
  629. \def\inforef #1{\inforefzzz #1,,,,**}
  630. \def\inforefzzz #1,#2,#3,#4**{See Info file \file{\losespace#3{}},
  631.   node \samp{\losespace#1{}}}
  632. \def\losespace #1{#1}
  633.  
  634. \message{fonts,}
  635.  
  636. % Font-change commands.
  637.  
  638. % Texinfo supports the sans serif font style, which plain TeX does not.
  639. % So we set up a \sf analogous to plain's \rm, etc.
  640. \newfam\sffam
  641. \def\sf{\fam=\sffam \tensf}
  642. \let\li = \sf % Sometimes we call it \li, not \sf.
  643.  
  644. %% Try out Computer Modern fonts at \magstephalf
  645. \let\mainmagstep=\magstephalf
  646.  
  647. \ifx\bigger\relax
  648. \let\mainmagstep=\magstep1
  649. \font\textrm=cmr12
  650. \font\texttt=cmtt12
  651. \else
  652. \font\textrm=cmr10 scaled \mainmagstep
  653. \font\texttt=cmtt10 scaled \mainmagstep
  654. \fi
  655. % Instead of cmb10, you many want to use cmbx10.
  656. % cmbx10 is a prettier font on its own, but cmb10
  657. % looks better when embedded in a line with cmr10.
  658. \font\textbf=cmb10 scaled \mainmagstep 
  659. \font\textit=cmti10 scaled \mainmagstep
  660. \font\textsl=cmsl10 scaled \mainmagstep
  661. \font\textsf=cmss10 scaled \mainmagstep
  662. \font\textsc=cmcsc10 scaled \mainmagstep
  663. \font\texti=cmmi10 scaled \mainmagstep
  664. \font\textsy=cmsy10 scaled \mainmagstep
  665.  
  666. % A few fonts for @defun, etc.
  667. \font\defbf=cmbx10 scaled \magstep1 %was 1314
  668. \font\deftt=cmtt10 scaled \magstep1
  669. \def\df{\let\tentt=\deftt \let\tenbf = \defbf \bf}
  670.  
  671. % Fonts for indices and small examples.
  672. % We actually use the slanted font rather than the italic, 
  673. % because texinfo normally uses the slanted fonts for that.
  674. % Do not make many font distinctions in general in the index, since they
  675. % aren't very useful.
  676. \font\ninett=cmtt9
  677. \font\indrm=cmr9
  678. \font\indit=cmsl9
  679. \let\indsl=\indit
  680. \let\indtt=\ninett
  681. \let\indsf=\indrm
  682. \let\indbf=\indrm
  683. \let\indsc=\indrm
  684. \font\indi=cmmi9
  685. \font\indsy=cmsy9
  686.  
  687. % Fonts for headings
  688. \font\chaprm=cmbx12 scaled \magstep2
  689. \font\chapit=cmti12 scaled \magstep2
  690. \font\chapsl=cmsl12 scaled \magstep2
  691. \font\chaptt=cmtt12 scaled \magstep2
  692. \font\chapsf=cmss12 scaled \magstep2
  693. \let\chapbf=\chaprm
  694. \font\chapsc=cmcsc10 scaled\magstep3
  695. \font\chapi=cmmi12 scaled \magstep2
  696. \font\chapsy=cmsy10 scaled \magstep3
  697.  
  698. \font\secrm=cmbx12 scaled \magstep1
  699. \font\secit=cmti12 scaled \magstep1
  700. \font\secsl=cmsl12 scaled \magstep1
  701. \font\sectt=cmtt12 scaled \magstep1
  702. \font\secsf=cmss12 scaled \magstep1
  703. \font\secbf=cmbx12 scaled \magstep1
  704. \font\secsc=cmcsc10 scaled\magstep2
  705. \font\seci=cmmi12 scaled \magstep1
  706. \font\secsy=cmsy10 scaled \magstep2
  707.  
  708. % \font\ssecrm=cmbx10 scaled \magstep1    % This size an font looked bad.
  709. % \font\ssecit=cmti10 scaled \magstep1    % The letters were too crowded.
  710. % \font\ssecsl=cmsl10 scaled \magstep1
  711. % \font\ssectt=cmtt10 scaled \magstep1
  712. % \font\ssecsf=cmss10 scaled \magstep1
  713.  
  714. %\font\ssecrm=cmb10 scaled 1315    % Note the use of cmb rather than cmbx.
  715. %\font\ssecit=cmti10 scaled 1315    % Also, the size is a little larger than
  716. %\font\ssecsl=cmsl10 scaled 1315    % being scaled magstep1.
  717. %\font\ssectt=cmtt10 scaled 1315
  718. %\font\ssecsf=cmss10 scaled 1315
  719.  
  720. %\let\ssecbf=\ssecrm
  721.  
  722. \font\ssecrm=cmbx12 scaled \magstephalf
  723. \font\ssecit=cmti12 scaled \magstephalf
  724. \font\ssecsl=cmsl12 scaled \magstephalf
  725. \font\ssectt=cmtt12 scaled \magstephalf
  726. \font\ssecsf=cmss12 scaled \magstephalf
  727. \font\ssecbf=cmbx12 scaled \magstephalf
  728. \font\ssecsc=cmcsc10 scaled \magstep1 
  729. \font\sseci=cmmi12 scaled \magstephalf
  730. \font\ssecsy=cmsy10 scaled \magstep1
  731. % The smallcaps and symbol fonts should actually be scaled \magstep1.5,
  732. % but that is not a standard magnification.
  733.  
  734. % Fonts for title page:
  735. \font\titlerm = cmbx12 scaled \magstep3
  736. \let\authorrm = \secrm
  737.  
  738. % In order for the font changes to affect most math symbols and letters,
  739. % we have to define the \textfont of the standard families.  Since
  740. % texinfo doesn't allow for producing subscripts and superscripts, we
  741. % don't bother to reset \scriptfont and \scriptscriptfont (which would
  742. % also require loading a lot more fonts).
  743. \def\resetmathfonts{%
  744.   \textfont0 = \tenrm \textfont1 = \teni \textfont2 = \tensy
  745.   \textfont\itfam = \tenit \textfont\slfam = \tensl \textfont\bffam = \tenbf
  746.   \textfont\ttfam = \tentt \textfont\sffam = \tensf
  747. }
  748.  
  749.  
  750. % The font-changing commands redefine the meanings of \tenSTYLE, instead
  751. % of just \STYLE.  We do this so that font changes will continue to work
  752. % in math mode, where it is the current \fam that is relevant in most
  753. % cases, not the current.  Plain TeX does, for example,
  754. % \def\bf{\fam=\bffam \tenbf}  By redefining \tenbf, we obviate the need
  755. % to redefine \bf itself.  
  756. \def\textfonts{%
  757.   \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl
  758.   \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc
  759.   \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy
  760.   \resetmathfonts}
  761. \def\chapfonts{%
  762.   \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl 
  763.   \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc
  764.   \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy
  765.   \resetmathfonts}
  766. \def\secfonts{%
  767.   \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl
  768.   \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc
  769.   \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy
  770.   \resetmathfonts}
  771. \def\subsecfonts{%
  772.   \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl
  773.   \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc
  774.   \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy
  775.   \resetmathfonts}
  776. \def\indexfonts{%
  777.   \let\tenrm=\indrm \let\tenit=\indit \let\tensl=\indsl
  778.   \let\tenbf=\indbf \let\tentt=\indtt \let\smallcaps=\indsc
  779.   \let\tensf=\indsf \let\teni=\indi \let\tensy=\indsy
  780.   \resetmathfonts}
  781.  
  782. % Set up the default fonts, so we can use them for creating boxes.
  783. \textfonts
  784.  
  785. % Count depth in font-changes, for error checks
  786. \newcount\fontdepth \fontdepth=0
  787.  
  788. % Fonts for short table of contents.
  789. \font\shortcontrm=cmr12
  790. \font\shortcontbf=cmbx12
  791. \font\shortcontsl=cmsl12
  792.  
  793. %% Add scribe-like font environments, plus @l for inline lisp (usually sans
  794. %% serif) and @ii for TeX italic
  795.  
  796. % \smartitalic{ARG} outputs arg in italics, followed by an italic correction
  797. % unless the following character is such as not to need one.
  798. \def\smartitalicx{\ifx\next,\else\ifx\next-\else\ifx\next.\else\/\fi\fi\fi}
  799. \def\smartitalic#1{{\sl #1}\futurelet\next\smartitalicx}
  800.  
  801. \let\i=\smartitalic
  802. \let\var=\smartitalic
  803. \let\dfn=\smartitalic
  804. \let\emph=\smartitalic
  805. \let\cite=\smartitalic
  806.  
  807. \def\b#1{{\bf #1}}
  808. \let\strong=\b
  809.  
  810. \def\t#1{{\tt \exhyphenpenalty=10000\rawbackslash \frenchspacing #1}\null}
  811. \let\ttfont = \t
  812. %\def\samp #1{`{\tt \rawbackslash \frenchspacing #1}'\null}
  813. \def\samp #1{`\tclose{#1}'\null}
  814. \def\key #1{{\tt \exhyphenpenalty=10000\uppercase{#1}}\null}
  815. \def\ctrl #1{{\tt \rawbackslash \hat}#1}
  816.  
  817. \let\file=\samp
  818.  
  819. % @code is a modification of @t,
  820. % which makes spaces the same size as normal in the surrounding text.
  821. \newdimen\tclosesave
  822. \newdimen\tcloserm
  823. \def\tclose#1{{\rm \tcloserm=\fontdimen2\font \tt \tclosesave=\fontdimen2\font
  824. \fontdimen2\font=\tcloserm
  825. % prevent breaking lines at hyphens.
  826. \exhyphenpenalty=10000
  827. \def\ {{\fontdimen2\font=\tclosesave{} }}%
  828.  \rawbackslash \frenchspacing #1\fontdimen2\font=\tclosesave}\null}
  829. \let\code=\tclose
  830. %\let\exp=\tclose  %Was temporary
  831.  
  832. % @kbd is like @code, except that if the argument is just one @key command, 
  833. % then @kbd has no effect.
  834.  
  835. \def\xkey{\key}
  836. \def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}%
  837. \ifx\one\xkey\ifx\threex\three \key{#2}%
  838. \else\tclose{\look}\fi
  839. \else\tclose{\look}\fi}
  840.  
  841. % Typeset a dimension, e.g., `in' or `pt'.  The only reason for the
  842. % argument is to make the input look right: @dmn{pt} instead of
  843. % @dmn{}pt.
  844. \def\dmn#1{\thinspace #1}
  845.  
  846. \def\kbd#1{\def\look{#1}\expandafter\kbdfoo\look??\par}
  847.  
  848. \def\l#1{{\li #1}\null}        % 
  849.  
  850. \def\r#1{{\rm #1}}        % roman font
  851. % Use of \lowercase was suggested.
  852. \def\sc#1{{\smallcaps#1}}    % smallcaps font
  853. \def\ii#1{{\it #1}}        % italic font
  854.  
  855. \message{page headings,}
  856.  
  857. \newskip\titlepagetopglue \titlepagetopglue = 1.5in
  858. \newskip\titlepagebottomglue \titlepagebottomglue = 2pc
  859.  
  860. % First the title page.  Must do @settitle before @titlepage.
  861. \def\titlefont#1{{\titlerm #1}}
  862.  
  863. \newtoks\realeverypar
  864. \newif\ifseenauthor
  865. \newif\iffinishedtitlepage
  866.  
  867. \def\titlepage{\begingroup \parindent=0pt \textfonts
  868.    \let\subtitlerm=\tenrm
  869. % I deinstalled the following change because \cmr12 is undefined.
  870. % This change was not in the ChangeLog anyway.  --rms.
  871. %   \let\subtitlerm=\cmr12
  872.    \def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}%
  873.    %
  874.    \def\authorfont{\authorrm \normalbaselineskip = 16pt \normalbaselines}%
  875.    %
  876.    % Leave some space at the very top of the page.
  877.    \vglue\titlepagetopglue
  878.    %
  879.    % Now you can print the title using @title.
  880.    \def\title{\parsearg\titlezzz}%
  881.    \def\titlezzz##1{\leftline{\titlefont{##1}}
  882.             % print a rule at the page bottom also.
  883.             \finishedtitlepagefalse
  884.             \vskip4pt \hrule height 4pt \vskip4pt}%
  885.    % No rule at page bottom unless we print one at the top with @title.
  886.    \finishedtitlepagetrue
  887.    %
  888.    % Now you can put text using @subtitle.
  889.    \def\subtitle{\parsearg\subtitlezzz}%
  890.    \def\subtitlezzz##1{{\subtitlefont \rightline{##1}}}%
  891.    %
  892.    % @author should come last, but may come many times.
  893.    \def\author{\parsearg\authorzzz}%
  894.    \def\authorzzz##1{\ifseenauthor\else\vskip 0pt plus 1filll\seenauthortrue\fi
  895.       {\authorfont \leftline{##1}}}%
  896.    %  
  897.    % Most title ``pages'' are actually two pages long, with space
  898.    % at the top of the second.  We don't want the ragged left on the second.
  899.    \let\oldpage = \page
  900.    \def\page{%
  901.       \iffinishedtitlepage\else
  902.      \finishtitlepage
  903.       \fi
  904.       \oldpage
  905.       \let\page = \oldpage
  906.       \hbox{}}%
  907. %   \def\page{\oldpage \hbox{}}
  908. }
  909.  
  910. \def\Etitlepage{%
  911.    \iffinishedtitlepage\else
  912.       \finishtitlepage
  913.    \fi
  914.    % It is important to do the page break before ending the group,
  915.    % because the headline and footline are only empty inside the group.
  916.    % If we use the new definition of \page, we always get a blank page
  917.    % after the title page, which we certainly don't want.
  918.    \oldpage
  919.    \endgroup
  920.    \HEADINGSon
  921. }
  922.  
  923. \def\finishtitlepage{%
  924.    \vskip4pt \hrule height 2pt
  925.    \vskip\titlepagebottomglue
  926.    \finishedtitlepagetrue
  927. }
  928.  
  929. %%% Set up page headings and footings.
  930.  
  931. \let\thispage=\folio
  932.  
  933. \newtoks \evenheadline    % Token sequence for heading line of even pages
  934. \newtoks \oddheadline     % Token sequence for heading line of odd pages
  935. \newtoks \evenfootline    % Token sequence for footing line of even pages
  936. \newtoks \oddfootline     % Token sequence for footing line of odd pages
  937.  
  938. % Now make Tex use those variables
  939. \headline={{\textfonts\rm \ifodd\pageno \the\oddheadline
  940.                             \else \the\evenheadline \fi}}
  941. \footline={{\textfonts\rm \ifodd\pageno \the\oddfootline
  942.                             \else \the\evenfootline \fi}\HEADINGShook}
  943. \let\HEADINGShook=\relax
  944.  
  945. % Commands to set those variables.
  946. % For example, this is what  @headings on  does
  947. % @evenheading @thistitle|@thispage|@thischapter
  948. % @oddheading @thischapter|@thispage|@thistitle
  949. % @evenfooting @thisfile||
  950. % @oddfooting ||@thisfile
  951.  
  952. \def\evenheading{\parsearg\evenheadingxxx}
  953. \def\oddheading{\parsearg\oddheadingxxx}
  954. \def\everyheading{\parsearg\everyheadingxxx}
  955.  
  956. \def\evenfooting{\parsearg\evenfootingxxx}
  957. \def\oddfooting{\parsearg\oddfootingxxx}
  958. \def\everyfooting{\parsearg\everyfootingxxx}
  959.  
  960. {\catcode`\@=0 %
  961.  
  962. \gdef\evenheadingxxx #1{\evenheadingyyy #1@|@|@|@|\finish}
  963. \gdef\evenheadingyyy #1@|#2@|#3@|#4\finish{%
  964. \global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
  965.  
  966. \gdef\oddheadingxxx #1{\oddheadingyyy #1@|@|@|@|\finish}
  967. \gdef\oddheadingyyy #1@|#2@|#3@|#4\finish{%
  968. \global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
  969.  
  970. \gdef\everyheadingxxx #1{\everyheadingyyy #1@|@|@|@|\finish}
  971. \gdef\everyheadingyyy #1@|#2@|#3@|#4\finish{%
  972. \global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}
  973. \global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
  974.  
  975. \gdef\evenfootingxxx #1{\evenfootingyyy #1@|@|@|@|\finish}
  976. \gdef\evenfootingyyy #1@|#2@|#3@|#4\finish{%
  977. \global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
  978.  
  979. \gdef\oddfootingxxx #1{\oddfootingyyy #1@|@|@|@|\finish}
  980. \gdef\oddfootingyyy #1@|#2@|#3@|#4\finish{%
  981. \global\oddfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
  982.  
  983. \gdef\everyfootingxxx #1{\everyfootingyyy #1@|@|@|@|\finish}
  984. \gdef\everyfootingyyy #1@|#2@|#3@|#4\finish{%
  985. \global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}
  986. \global\oddfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
  987. %
  988. }% unbind the catcode of @.
  989.  
  990. % @headings double    turns headings on for double-sided printing.
  991. % @headings single    turns headings on for single-sided printing.
  992. % @headings off        turns them off.
  993. % @headings on        same as @headings double, retained for compatibility.
  994. % @headings after    turns on double-sided headings after this page.
  995. % @headings doubleafter    turns on double-sided headings after this page.
  996. % @headings singleafter turns on single-sided headings after this page.
  997. % By default, they are off.
  998.  
  999. \def\headings #1 {\csname HEADINGS#1\endcsname}
  1000.  
  1001. \def\HEADINGSoff{
  1002. \global\evenheadline={\hfil} \global\evenfootline={\hfil}
  1003. \global\oddheadline={\hfil} \global\oddfootline={\hfil}}
  1004. \HEADINGSoff
  1005. % When we turn headings on, set the page number to 1.
  1006. % For double-sided printing, put current file name in lower left corner,
  1007. % chapter name on inside top of right hand pages, document
  1008. % title on inside top of left hand pages, and page numbers on outside top
  1009. % edge of all pages.
  1010. \def\HEADINGSdouble{
  1011. %\pagealignmacro
  1012. \global\pageno=1
  1013. \global\evenfootline={\hfil}
  1014. \global\oddfootline={\hfil}
  1015. \global\evenheadline={\line{\folio\hfil\thistitle}}
  1016. \global\oddheadline={\line{\thischapter\hfil\folio}}
  1017. }
  1018. % For single-sided printing, chapter title goes across top left of page,
  1019. % page number on top right.
  1020. \def\HEADINGSsingle{
  1021. %\pagealignmacro
  1022. \global\pageno=1
  1023. \global\evenfootline={\hfil}
  1024. \global\oddfootline={\hfil}
  1025. \global\evenheadline={\line{\thischapter\hfil\folio}}
  1026. \global\oddheadline={\line{\thischapter\hfil\folio}}
  1027. }
  1028. \def\HEADINGSon{\HEADINGSdouble}
  1029.  
  1030. \def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex}
  1031. \let\HEADINGSdoubleafter=\HEADINGSafter
  1032. \def\HEADINGSdoublex{%
  1033. \global\evenfootline={\hfil}
  1034. \global\oddfootline={\hfil}
  1035. \global\evenheadline={\line{\folio\hfil\thistitle}}
  1036. \global\oddheadline={\line{\thischapter\hfil\folio}}
  1037. }
  1038.  
  1039. \def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex}
  1040. \def\HEADINGSsinglex{%
  1041. \global\evenfootline={\hfil}
  1042. \global\oddfootline={\hfil}
  1043. \global\evenheadline={\line{\thischapter\hfil\folio}}
  1044. \global\oddheadline={\line{\thischapter\hfil\folio}}
  1045. }
  1046.  
  1047. % Subroutines used in generating headings
  1048. % Produces Day Month Year style of output.
  1049. \def\today{\number\day\space
  1050. \ifcase\month\or
  1051. January\or February\or March\or April\or May\or June\or
  1052. July\or August\or September\or October\or November\or December\fi
  1053. \space\number\year}
  1054.  
  1055. % Use this if you want the Month Day, Year style of output.
  1056. %\def\today{\ifcase\month\or
  1057. %January\or February\or March\or April\or May\or June\or
  1058. %July\or August\or September\or October\or November\or December\fi
  1059. %\space\number\day, \number\year}
  1060.  
  1061. % @settitle line...  specifies the title of the document, for headings
  1062. % It generates no output of its own
  1063.  
  1064. \def\thistitle{No Title}
  1065. \def\settitle{\parsearg\settitlezzz}
  1066. \def\settitlezzz #1{\gdef\thistitle{#1}}
  1067.  
  1068. \message{tables,}
  1069.  
  1070. % @tabs -- simple alignment
  1071.  
  1072. % These don't work.  For one thing, \+ is defined as outer.
  1073. % So these macros cannot even be defined.
  1074.  
  1075. %\def\tabs{\parsearg\tabszzz}
  1076. %\def\tabszzz #1{\settabs\+#1\cr}
  1077. %\def\tabline{\parsearg\tablinezzz}
  1078. %\def\tablinezzz #1{\+#1\cr}
  1079. %\def\&{&}
  1080.  
  1081. % Tables -- @table, @ftable, @vtable, @item(x), @kitem(x), @xitem(x).
  1082.  
  1083. % default indentation of table text
  1084. \newdimen\tableindent \tableindent=.8in
  1085. % default indentation of @itemize and @enumerate text
  1086. \newdimen\itemindent  \itemindent=.3in
  1087. % margin between end of table item and start of table text.
  1088. \newdimen\itemmargin  \itemmargin=.1in
  1089.  
  1090. % used internally for \itemindent minus \itemmargin
  1091. \newdimen\itemmax
  1092.  
  1093. % Note @table, @vtable, and @vtable define @item, @itemx, etc., with
  1094. % these defs.
  1095. % They also define \itemindex
  1096. % to index the item name in whatever manner is desired (perhaps none).
  1097.  
  1098. \def\internalBitem{\smallbreak \parsearg\itemzzz}
  1099. \def\internalBitemx{\par \parsearg\itemzzz}
  1100.  
  1101. \def\internalBxitem "#1"{\def\xitemsubtopix{#1} \smallbreak \parsearg\xitemzzz}
  1102. \def\internalBxitemx "#1"{\def\xitemsubtopix{#1} \par \parsearg\xitemzzz}
  1103.  
  1104. \def\internalBkitem{\smallbreak \parsearg\kitemzzz}
  1105. \def\internalBkitemx{\par \parsearg\kitemzzz}
  1106.  
  1107. \def\kitemzzz #1{\dosubind {kw}{\code{#1}}{for {\bf \lastfunction}}%
  1108.                  \itemzzz {#1}}
  1109.  
  1110. \def\xitemzzz #1{\dosubind {kw}{\code{#1}}{for {\bf \xitemsubtopic}}%
  1111.                  \itemzzz {#1}}
  1112.  
  1113. \def\itemzzz #1{\begingroup %
  1114.   \advance\hsize by -\rightskip
  1115.   \advance\hsize by -\tableindent
  1116.   \setbox0=\hbox{\itemfont{#1}}%
  1117.   \itemindex{#1}%
  1118.   \nobreak % This prevents a break before @itemx.
  1119.   %
  1120.   % Be sure we are not still in the middle of a paragraph.
  1121.   \parskip=0in
  1122.   \par
  1123.   %
  1124.   % If the item text does not fit in the space we have, put it on a line
  1125.   % by itself, and do not allow a page break either before or after that
  1126.   % line.  We do not start a paragraph here because then if the next
  1127.   % command is, e.g., @kindex, the whatsit would get put into the
  1128.   % horizontal list on a line by itself, resulting in extra blank space.
  1129.   \ifdim \wd0>\itemmax
  1130.     \setbox0=\hbox{\hskip \leftskip \hskip -\tableindent \unhbox0}\box0
  1131.     \nobreak
  1132.   \else
  1133.     % The item text fits into the space.  Start a paragraph, so that the
  1134.     % following text (if any) will end up on the same line.  Since that
  1135.     % text will be indented by \tableindent, we make the item text be in
  1136.     % a zero-width box.
  1137.     \noindent
  1138.     \rlap{\hskip -\tableindent\box0}%
  1139.   \fi
  1140.   \endgroup
  1141. }
  1142.  
  1143. \def\item{\errmessage{@item while not in a table}}
  1144. \def\itemx{\errmessage{@itemx while not in a table}}
  1145. \def\kitem{\errmessage{@kitem while not in a table}}
  1146. \def\kitemx{\errmessage{@kitemx while not in a table}}
  1147. \def\xitem{\errmessage{@xitem while not in a table}}
  1148. \def\xitemx{\errmessage{@xitemx while not in a table}}
  1149.  
  1150. %% Contains a kludge to get @end[description] to work
  1151. \def\description{\tablez{\dontindex}{1}{}{}{}{}}
  1152.  
  1153. \def\table{\begingroup\inENV\obeylines\obeyspaces\tablex}
  1154. {\obeylines\obeyspaces%
  1155. \gdef\tablex #1^^M{%
  1156. \tabley\dontindex#1        \endtabley}}
  1157.  
  1158. \def\ftable{\begingroup\inENV\obeylines\obeyspaces\ftablex}
  1159. {\obeylines\obeyspaces%
  1160. \gdef\ftablex #1^^M{%
  1161. \tabley\fnitemindex#1        \endtabley
  1162. \def\Eftable{\endgraf\endgroup\afterenvbreak}%
  1163. \let\Etable=\relax}}
  1164.  
  1165. \def\vtable{\begingroup\inENV\obeylines\obeyspaces\vtablex}
  1166. {\obeylines\obeyspaces%
  1167. \gdef\vtablex #1^^M{%
  1168. \tabley\vritemindex#1        \endtabley
  1169. \def\Evtable{\endgraf\endgroup\afterenvbreak}%
  1170. \let\Etable=\relax}}
  1171.  
  1172. \def\dontindex #1{}
  1173. \def\fnitemindex #1{\doind {fn}{\code{#1}}}%
  1174. \def\vritemindex #1{\doind {vr}{\code{#1}}}%
  1175.  
  1176. {\obeyspaces %
  1177. \gdef\tabley#1#2 #3 #4 #5 #6 #7\endtabley{\endgroup%
  1178. \tablez{#1}{#2}{#3}{#4}{#5}{#6}}}
  1179.  
  1180. \def\tablez #1#2#3#4#5#6{%
  1181. \aboveenvbreak %
  1182. \begingroup %
  1183. \def\Edescription{\Etable}% Neccessary kludge.
  1184. \let\itemindex=#1%
  1185. \ifnum 0#3>0 \advance \leftskip by #3\mil \fi %
  1186. \ifnum 0#4>0 \tableindent=#4\mil \fi %
  1187. \ifnum 0#5>0 \advance \rightskip by #5\mil \fi %
  1188. \def\itemfont{#2}%
  1189. \itemmax=\tableindent %
  1190. \advance \itemmax by -\itemmargin %
  1191. \advance \leftskip by \tableindent %
  1192. \exdentamount=\tableindent
  1193. \parindent = 0pt
  1194. \parskip = \smallskipamount
  1195. \ifdim \parskip=0pt \parskip=2pt \fi%
  1196. \def\Etable{\endgraf\endgroup\afterenvbreak}%
  1197. \let\item = \internalBitem %
  1198. \let\itemx = \internalBitemx %
  1199. \let\kitem = \internalBkitem %
  1200. \let\kitemx = \internalBkitemx %
  1201. \let\xitem = \internalBxitem %
  1202. \let\xitemx = \internalBxitemx %
  1203. }
  1204.  
  1205. % This is the counter used by @enumerate, which is really @itemize
  1206.  
  1207. \newcount \itemno
  1208.  
  1209. \def\itemize{\parsearg\itemizezzz}
  1210.  
  1211. \def\itemizezzz #1{%
  1212.   \begingroup % ended by the @end itemsize
  1213.   \itemizey {#1}{\Eitemize}
  1214. }
  1215.  
  1216. \def\itemizey #1#2{%
  1217. \aboveenvbreak %
  1218. \itemmax=\itemindent %
  1219. \advance \itemmax by -\itemmargin %
  1220. \advance \leftskip by \itemindent %
  1221. \exdentamount=\itemindent
  1222. \parindent = 0pt %
  1223. \parskip = \smallskipamount %
  1224. \ifdim \parskip=0pt \parskip=2pt \fi%
  1225. \def#2{\endgraf\endgroup\afterenvbreak}%
  1226. \def\itemcontents{#1}%
  1227. \let\item=\itemizeitem}
  1228.  
  1229. \def\bullet{$\ptexbullet$}
  1230. \def\minus{$-$}
  1231.  
  1232. % Set sfcode to normal for the chars that usually have another value.
  1233. % These are `.?!:;,'
  1234. \def\frenchspacing{\sfcode46=1000 \sfcode63=1000 \sfcode33=1000
  1235.   \sfcode58=1000 \sfcode59=1000 \sfcode44=1000 }
  1236.  
  1237. % \splitoff TOKENS\endmark defines \first to be the first token in
  1238. % TOKENS, and \rest to be the remainder.
  1239. \def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}%
  1240.  
  1241. % Allow an optional argument of an uppercase letter, lowercase letter,
  1242. % or number, to specify the first label in the enumerated list.  No
  1243. % argument is the same as `1'.
  1244. \def\enumerate{\parsearg\enumeratezzz}
  1245. \def\enumeratezzz #1{\enumeratey #1  \endenumeratey}
  1246. \def\enumeratey #1 #2\endenumeratey{%
  1247.   \begingroup % ended by the @end enumerate
  1248.   %
  1249.   % If we were given no argument, pretend we were given `1'.
  1250.   \def\thearg{#1}%
  1251.   \ifx\thearg\empty \def\thearg{1}\fi
  1252.   %
  1253.   % Detect if the argument is a single token.  If so, it might be a
  1254.   % letter.  Otherwise, the only valid thing it can be is a number.
  1255.   % (We will always have one token, because of the test we just made.
  1256.   % This is a good thing, since \splitoff doesn't work given nothing at
  1257.   % all -- the first parameter is undelimited.)
  1258.   \expandafter\splitoff\thearg\endmark
  1259.   \ifx\rest\empty
  1260.     % Only one token in the argument.  It could still be anything.
  1261.     % A ``lowercase letter'' is one whose \lccode is nonzero.
  1262.     % An ``uppercase letter'' is one whose \lccode is both nonzero, and
  1263.     %   not equal to itself.
  1264.     % Otherwise, we assume it's a number.
  1265.     % 
  1266.     % We need the \relax at the end of the \ifnum lines to stop TeX from
  1267.     % continuing to look for a <number>.
  1268.     % 
  1269.     \ifnum\lccode\expandafter`\thearg=0\relax 
  1270.       \numericenumerate % a number (we hope)
  1271.     \else
  1272.       % It's a letter.
  1273.       \ifnum\lccode\expandafter`\thearg=\expandafter`\thearg\relax
  1274.         \lowercaseenumerate % lowercase letter
  1275.       \else
  1276.         \uppercaseenumerate % uppercase letter
  1277.       \fi
  1278.     \fi
  1279.   \else
  1280.     % Multiple tokens in the argument.  We hope it's a number.
  1281.     \numericenumerate
  1282.   \fi
  1283. }
  1284.  
  1285. % An @enumerate whose labels are integers.  The starting integer is
  1286. % given in \thearg.
  1287. \def\numericenumerate{%
  1288.   \itemno = \thearg
  1289.   \startenumeration{\the\itemno}%
  1290. }
  1291.  
  1292. % The starting (lowercase) letter is in \thearg.
  1293. \def\lowercaseenumerate{%
  1294.   \itemno = \expandafter`\thearg
  1295.   \startenumeration{%
  1296.     % Be sure we're not beyond the end of the alphabet.
  1297.     \ifnum\itemno=0
  1298.       \errmessage{No more lowercase letters in @enumerate; get a bigger
  1299.                   alphabet}%
  1300.     \fi
  1301.     \char\lccode\itemno
  1302.   }%
  1303. }
  1304.  
  1305. % The starting (uppercase) letter is in \thearg.
  1306. \def\uppercaseenumerate{%
  1307.   \itemno = \expandafter`\thearg
  1308.   \startenumeration{%
  1309.     % Be sure we're not beyond the end of the alphabet.
  1310.     \ifnum\itemno=0
  1311.       \errmessage{No more uppercase letters in @enumerate; get a bigger
  1312.                   alphabet}
  1313.     \fi
  1314.     \char\uccode\itemno
  1315.   }%
  1316. }
  1317.  
  1318. % Call itemizey, adding a period to the first argument and supplying the
  1319. % common last two arguments.  Also subtract one from the initial value in
  1320. % \itemno, since @item increments \itemno.
  1321. \def\startenumeration#1{%
  1322.   \advance\itemno by -1
  1323.   \itemizey{#1.}\Eenumerate\flushcr
  1324. }
  1325.  
  1326. % @alphaenumerate and @capsenumerate are abbreviations for giving an arg
  1327. % to @enumerate.
  1328. \def\alphaenumerate{\enumerate{a}}
  1329. \def\capsenumerate{\enumerate{A}}
  1330. \def\Ealphaenumerate{\Eenumerate}
  1331. \def\Ecapsenumerate{\Eenumerate}
  1332.  
  1333. % Definition of @item while inside @itemize.
  1334.  
  1335. \def\itemizeitem{%
  1336. \advance\itemno by 1
  1337. {\let\par=\endgraf \smallbreak}%
  1338. \ifhmode \errmessage{\in hmode at itemizeitem}\fi
  1339. {\parskip=0in \hskip 0pt
  1340. \hbox to 0pt{\hss \itemcontents\hskip \itemmargin}%
  1341. \vadjust{\penalty 1200}}%
  1342. \flushcr}
  1343.  
  1344. \message{indexing,}
  1345. % Index generation facilities
  1346.  
  1347. % Define \newwrite to be identical to plain tex's \newwrite
  1348. % except not \outer, so it can be used within \newindex.
  1349. {\catcode`\@=11
  1350. \gdef\newwrite{\alloc@7\write\chardef\sixt@@n}}
  1351.  
  1352. % \newindex {foo} defines an index named foo.
  1353. % It automatically defines \fooindex such that
  1354. % \fooindex ...rest of line... puts an entry in the index foo.
  1355. % It also defines \fooindfile to be the number of the output channel for
  1356. % the file that    accumulates this index.  The file's extension is foo.
  1357. % The name of an index should be no more than 2 characters long
  1358. % for the sake of vms.
  1359.  
  1360. \def\newindex #1{
  1361. \expandafter\newwrite \csname#1indfile\endcsname% Define number for output file
  1362. \openout \csname#1indfile\endcsname \jobname.#1    % Open the file
  1363. \expandafter\xdef\csname#1index\endcsname{%    % Define \xxxindex
  1364. \noexpand\doindex {#1}}
  1365. }
  1366.  
  1367. % @defindex foo  ==  \newindex{foo}
  1368.  
  1369. \def\defindex{\parsearg\newindex}
  1370.  
  1371. % Define @defcodeindex, like @defindex except put all entries in @code.
  1372.  
  1373. \def\newcodeindex #1{
  1374. \expandafter\newwrite \csname#1indfile\endcsname% Define number for output file
  1375. \openout \csname#1indfile\endcsname \jobname.#1    % Open the file
  1376. \expandafter\xdef\csname#1index\endcsname{%    % Define \xxxindex
  1377. \noexpand\docodeindex {#1}}
  1378. }
  1379.  
  1380. \def\defcodeindex{\parsearg\newcodeindex}
  1381.  
  1382. % @synindex foo bar    makes index foo feed into index bar.
  1383. % Do this instead of @defindex foo if you don't want it as a separate index.
  1384. \def\synindex #1 #2 {%
  1385. \expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname
  1386. \expandafter\let\csname#1indfile\endcsname=\synindexfoo
  1387. \expandafter\xdef\csname#1index\endcsname{%    % Define \xxxindex
  1388. \noexpand\doindex {#2}}%
  1389. }
  1390.  
  1391. % @syncodeindex foo bar   similar, but put all entries made for index foo
  1392. % inside @code.
  1393. \def\syncodeindex #1 #2 {%
  1394. \expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname
  1395. \expandafter\let\csname#1indfile\endcsname=\synindexfoo
  1396. \expandafter\xdef\csname#1index\endcsname{%    % Define \xxxindex
  1397. \noexpand\docodeindex {#2}}%
  1398. }
  1399.  
  1400. % Define \doindex, the driver for all \fooindex macros.
  1401. % Argument #1 is generated by the calling \fooindex macro,
  1402. %  and it is "foo", the name of the index.
  1403.  
  1404. % \doindex just uses \parsearg; it calls \doind for the actual work.
  1405. % This is because \doind is more useful to call from other macros.
  1406.  
  1407. % There is also \dosubind {index}{topic}{subtopic}
  1408. % which makes an entry in a two-level index such as the operation index.
  1409.  
  1410. \def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer}
  1411. \def\singleindexer #1{\doind{\indexname}{#1}}
  1412.  
  1413. % like the previous two, but they put @code around the argument.
  1414. \def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer}
  1415. \def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}}
  1416.  
  1417. \def\indexdummies{%
  1418. \def\_{{\realbackslash _}}%
  1419. \def\w{\realbackslash w }%
  1420. \def\bf{\realbackslash bf }%
  1421. \def\rm{\realbackslash rm }%
  1422. \def\sl{\realbackslash sl }%
  1423. \def\sf{\realbackslash sf}%
  1424. \def\tt{\realbackslash tt}%
  1425. \def\gtr{\realbackslash gtr}%
  1426. \def\less{\realbackslash less}%
  1427. \def\hat{\realbackslash hat}%
  1428. \def\char{\realbackslash char}%
  1429. \def\TeX{\realbackslash TeX}%
  1430. \def\dots{\realbackslash dots }%
  1431. \def\copyright{\realbackslash copyright }%
  1432. \def\tclose##1{\realbackslash tclose {##1}}%
  1433. \def\code##1{\realbackslash code {##1}}%
  1434. \def\samp##1{\realbackslash samp {##1}}%
  1435. \def\t##1{\realbackslash r {##1}}%
  1436. \def\r##1{\realbackslash r {##1}}%
  1437. \def\i##1{\realbackslash i {##1}}%
  1438. \def\b##1{\realbackslash b {##1}}%
  1439. \def\cite##1{\realbackslash cite {##1}}%
  1440. \def\key##1{\realbackslash key {##1}}%
  1441. \def\file##1{\realbackslash file {##1}}%
  1442. \def\var##1{\realbackslash var {##1}}%
  1443. \def\kbd##1{\realbackslash kbd {##1}}%
  1444. }
  1445.  
  1446. % \indexnofonts no-ops all font-change commands.
  1447. % This is used when outputting the strings to sort the index by.
  1448. \def\indexdummyfont#1{#1}
  1449. \def\indexdummytex{TeX}
  1450. \def\indexdummydots{...}
  1451.  
  1452. \def\indexnofonts{%
  1453. \let\w=\indexdummyfont
  1454. \let\t=\indexdummyfont
  1455. \let\r=\indexdummyfont
  1456. \let\i=\indexdummyfont
  1457. \let\b=\indexdummyfont
  1458. \let\emph=\indexdummyfont
  1459. \let\strong=\indexdummyfont
  1460. \let\cite=\indexdummyfont
  1461. \let\sc=\indexdummyfont
  1462. %Don't no-op \tt, since it isn't a user-level command
  1463. % and is used in the definitions of the active chars like <, >, |...
  1464. %\let\tt=\indexdummyfont
  1465. \let\tclose=\indexdummyfont
  1466. \let\code=\indexdummyfont
  1467. \let\file=\indexdummyfont
  1468. \let\samp=\indexdummyfont
  1469. \let\kbd=\indexdummyfont
  1470. \let\key=\indexdummyfont
  1471. \let\var=\indexdummyfont
  1472. \let\TeX=\indexdummytex
  1473. \let\dots=\indexdummydots
  1474. }
  1475.  
  1476. % To define \realbackslash, we must make \ not be an escape.
  1477. % We must first make another character (@) an escape
  1478. % so we do not become unable to do a definition.
  1479.  
  1480. {\catcode`\@=0 \catcode`\\=\other
  1481. @gdef@realbackslash{\}}
  1482.  
  1483. \let\indexbackslash=0  %overridden during \printindex.
  1484.  
  1485. \def\doind #1#2{%
  1486. {\count10=\lastpenalty %
  1487. {\indexdummies % Must do this here, since \bf, etc expand at this stage
  1488. \escapechar=`\\%
  1489. {\let\folio=0% Expand all macros now EXCEPT \folio
  1490. \def\rawbackslashxx{\indexbackslash}% \indexbackslash isn't defined now
  1491. % so it will be output as is; and it will print as backslash in the indx.
  1492. %
  1493. % Now process the index-string once, with all font commands turned off,
  1494. % to get the string to sort the index by.
  1495. {\indexnofonts
  1496. \xdef\temp1{#2}%
  1497. }%
  1498. % Now produce the complete index entry.  We process the index-string again,
  1499. % this time with font commands expanded, to get what to print in the index.
  1500. \edef\temp{%
  1501. \write \csname#1indfile\endcsname{%
  1502. \realbackslash entry {\temp1}{\folio}{#2}}}%
  1503. \temp }%
  1504. }\penalty\count10}}
  1505.  
  1506. \def\dosubind #1#2#3{%
  1507. {\count10=\lastpenalty %
  1508. {\indexdummies % Must do this here, since \bf, etc expand at this stage
  1509. \escapechar=`\\%
  1510. {\let\folio=0%
  1511. \def\rawbackslashxx{\indexbackslash}%
  1512. %
  1513. % Now process the index-string once, with all font commands turned off,
  1514. % to get the string to sort the index by.
  1515. {\indexnofonts
  1516. \xdef\temp1{#2 #3}%
  1517. }%
  1518. % Now produce the complete index entry.  We process the index-string again,
  1519. % this time with font commands expanded, to get what to print in the index.
  1520. \edef\temp{%
  1521. \write \csname#1indfile\endcsname{%
  1522. \realbackslash entry {\temp1}{\folio}{#2}{#3}}}%
  1523. \temp }%
  1524. }\penalty\count10}}
  1525.  
  1526. % The index entry written in the file actually looks like
  1527. %  \entry {sortstring}{page}{topic}
  1528. % or
  1529. %  \entry {sortstring}{page}{topic}{subtopic}
  1530. % The texindex program reads in these files and writes files
  1531. % containing these kinds of lines:
  1532. %  \initial {c}
  1533. %     before the first topic whose initial is c
  1534. %  \entry {topic}{pagelist}
  1535. %     for a topic that is used without subtopics
  1536. %  \primary {topic}
  1537. %     for the beginning of a topic that is used with subtopics
  1538. %  \secondary {subtopic}{pagelist}
  1539. %     for each subtopic.
  1540.  
  1541. % Define the user-accessible indexing commands 
  1542. % @findex, @vindex, @kindex, @cindex.
  1543.  
  1544. \def\findex {\fnindex}
  1545. \def\kindex {\kyindex}
  1546. \def\cindex {\cpindex}
  1547. \def\vindex {\vrindex}
  1548. \def\tindex {\tpindex}
  1549. \def\pindex {\pgindex}
  1550.  
  1551. \def\cindexsub {\begingroup\obeylines\cindexsub}
  1552. {\obeylines %
  1553. \gdef\cindexsub "#1" #2^^M{\endgroup %
  1554. \dosubind{cp}{#2}{#1}}}
  1555.  
  1556. % Define the macros used in formatting output of the sorted index material.
  1557.  
  1558. % This is what you call to cause a particular index to get printed.
  1559. % Write
  1560. % @unnumbered Function Index
  1561. % @printindex fn
  1562.  
  1563. \def\printindex{\parsearg\doprintindex}
  1564.  
  1565. \def\doprintindex#1{%
  1566.   \tex
  1567.   \dobreak \chapheadingskip {10000}
  1568.   \catcode`\%=\other\catcode`\&=\other\catcode`\#=\other
  1569.   \catcode`\$=\other\catcode`\_=\other
  1570.   \catcode`\~=\other
  1571.   %
  1572.   % The following don't help, since the chars were translated
  1573.   % when the raw index was written, and their fonts were discarded
  1574.   % due to \indexnofonts.
  1575.   %\catcode`\"=\active
  1576.   %\catcode`\^=\active
  1577.   %\catcode`\_=\active
  1578.   %\catcode`\|=\active
  1579.   %\catcode`\<=\active
  1580.   %\catcode`\>=\active
  1581.   % %
  1582.   \def\indexbackslash{\rawbackslashxx}
  1583.   \indexfonts\rm \tolerance=9500 \advance\baselineskip -1pt
  1584.   \begindoublecolumns
  1585.   %
  1586.   % See if the index file exists and is nonempty.
  1587.   \openin 1 \jobname.#1s
  1588.   \ifeof 1 
  1589.     % \enddoublecolumns gets confused if there is no text in the index,
  1590.     % and it loses the chapter title and the aux file entries for the
  1591.     % index.  The easiest way to prevent this problem is to make sure
  1592.     % there is some text.
  1593.     (Index is nonexistent)
  1594.     \else
  1595.     %
  1596.     % If the index file exists but is empty, then \openin leaves \ifeof
  1597.     % false.  We have to make TeX try to read something from the file, so
  1598.     % it can discover if there is anything in it.
  1599.     \read 1 to \temp
  1600.     \ifeof 1
  1601.       (Index is empty)
  1602.     \else
  1603.       \input \jobname.#1s
  1604.     \fi
  1605.   \fi
  1606.   \closein 1
  1607.   \enddoublecolumns
  1608.   \Etex
  1609. }
  1610.  
  1611. % These macros are used by the sorted index file itself.
  1612. % Change them to control the appearance of the index.
  1613.  
  1614. % Same as \bigskipamount except no shrink.
  1615. % \balancecolumns gets confused if there is any shrink.
  1616. \newskip\initialskipamount \initialskipamount 12pt plus4pt
  1617.  
  1618. \def\initial #1{%
  1619. {\let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt
  1620. \ifdim\lastskip<\initialskipamount
  1621. \removelastskip \penalty-200 \vskip \initialskipamount\fi
  1622. \line{\secbf#1\hfill}\kern 2pt\penalty10000}}
  1623.  
  1624. % This typesets a paragraph consisting of #1, dot leaders, and then #2
  1625. % flush to the right margin.  It is used for index and table of contents
  1626. % entries.  The paragraph is indented by \leftskip.
  1627. \def\entry #1#2{\begingroup
  1628.   %
  1629.   % Start a new paragraph if necessary, so our assignments below can't
  1630.   % affect previous text.
  1631.   \par
  1632.   %
  1633.   % Do not fill out the last line with white space.
  1634.   \parfillskip = 0in
  1635.   %
  1636.   % No extra space above this paragraph.
  1637.   \parskip = 0in
  1638.   %
  1639.   % Do not prefer a separate line ending with a hyphen to fewer lines.
  1640.   \finalhyphendemerits = 0
  1641.   %
  1642.   % \hangindent is only relevant when the entry text and page number
  1643.   % don't both fit on one line.  In that case, bob suggests starting the
  1644.   % dots pretty far over on the line.  Unfortunately, a large
  1645.   % indentation looks wrong when the entry text itself is broken across
  1646.   % lines.  So we use a small indentation and put up with long leaders.
  1647.   % 
  1648.   % \hangafter is reset to 1 (which is the value we want) at the start
  1649.   % of each paragraph, so we need not do anything with that.
  1650.   \hangindent=2em
  1651.   %
  1652.   % When the entry text needs to be broken, just fill out the first line
  1653.   % with blank space.
  1654.   \rightskip = 0pt plus1fil
  1655.   %
  1656.   % Start a ``paragraph'' for the index entry so the line breaking
  1657.   % parameters we've set above will have an effect.
  1658.   \noindent
  1659.   %
  1660.   % Insert the text of the index entry.  TeX will do line-breaking on it.
  1661.   #1%
  1662.   %
  1663.   % If we must, put the page number on a line of its own, and fill out
  1664.   % this line with blank space.  (The \hfil is overwhelmed with the
  1665.   % fill leaders glue in \indexdotfill if the page number does fit.)
  1666.   \hfil\penalty50
  1667.   \null\nobreak\indexdotfill % Have leaders before the page number.
  1668.   %
  1669.   % The `\ ' here is removed by the implicit \unskip that TeX does as
  1670.   % part of (the primitive) \par.  Without it, a spurious underfull
  1671.   % \hbox ensues.
  1672.   \ #2% The page number ends the paragraph.
  1673.   \par
  1674. \endgroup}
  1675.  
  1676. % Like \dotfill except takes at least 1 em.
  1677. \def\indexdotfill{\cleaders
  1678.   \hbox{$\mathsurround=0pt \mkern1.5mu . \mkern1.5mu$}\hskip 1em plus 1fill}
  1679.  
  1680. \def\primary #1{\line{#1\hfil}}
  1681.  
  1682. \newskip\secondaryindent \secondaryindent=0.5cm
  1683.  
  1684. \def\secondary #1#2{
  1685. {\parfillskip=0in \parskip=0in
  1686. \hangindent =1in \hangafter=1
  1687. \noindent\hskip\secondaryindent\hbox{#1}\indexdotfill #2\par
  1688. }}
  1689.  
  1690. %% Define two-column mode, which is used in indexes.
  1691. %% Adapted from the TeXbook, page 416.
  1692. \catcode `\@=11
  1693.  
  1694. \newbox\partialpage
  1695.  
  1696. \newdimen\doublecolumnhsize
  1697. \newdimen\availdimen@
  1698.  
  1699. \def\begindoublecolumns{\begingroup
  1700.   % Grab any single-column material above us.
  1701.   \output = {\global\setbox\partialpage
  1702.     =\vbox{\unvbox255\kern -\topskip \kern \baselineskip}}%
  1703.   \eject
  1704.   %
  1705.   % Now switch to the double-column output routine.
  1706.   \output={\doublecolumnout}%
  1707.   %
  1708.   % Change the page size parameters.  We could do this once outside this
  1709.   % routine, in each of @smallbook, @afourpaper, and the default 8.5x11
  1710.   % format, but then we repeat the same computation.  Repeating a couple
  1711.   % of assignments once per index is clearly meaningless for the
  1712.   % execution time, so we may as well do it once.
  1713.   % 
  1714.   % First we halve the line length, less a little for the gutter between
  1715.   % the columns.  We compute the gutter based on the line length, so it
  1716.   % changes automatically with the paper format.  The magic constant
  1717.   % below is chosen so that the gutter has the same value (well, +- <
  1718.   % 1pt) as it did when we hard-coded it.
  1719.   % 
  1720.   % We put the result in a separate register, \doublecolumhsize, so we
  1721.   % can restore it in \pagesofar, after \hsize itself has (potentially)
  1722.   % been clobbered.
  1723.   % 
  1724.   \doublecolumnhsize = \hsize
  1725.     \advance\doublecolumnhsize by -.04154\hsize
  1726.     \divide\doublecolumnhsize by 2
  1727.   \hsize = \doublecolumnhsize
  1728.   %
  1729.   % Double the \vsize as well.  (We don't need a separate register here,
  1730.   % since nobody clobbers \vsize.)
  1731.   \vsize = 2\vsize
  1732. }
  1733.  
  1734. \def\enddoublecolumns{\output={\balancecolumns}\eject
  1735.   \endgroup \pagegoal=\vsize}
  1736.  
  1737. \def\doublecolumnout{\splittopskip=\topskip \splitmaxdepth=\maxdepth
  1738.   \dimen@=\pageheight \advance\dimen@ by-\ht\partialpage
  1739.   \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@
  1740.   \onepageout\pagesofar \unvbox255 \penalty\outputpenalty}
  1741. \def\pagesofar{\unvbox\partialpage %
  1742.   \hsize=\doublecolumnhsize % have to restore this since output routine
  1743. %          changes it to set cropmarks (P. A. MacKay, 12 Nov. 1986)
  1744.   \wd0=\hsize \wd2=\hsize \hbox to\pagewidth{\box0\hfil\box2}}
  1745. \def\balancecolumns{%
  1746. % Unset the glue.
  1747.   \setbox255=\vbox{\unvbox255}
  1748.   \dimen@=\ht255
  1749.   \advance\dimen@ by\topskip \advance\dimen@ by-\baselineskip
  1750.   \divide\dimen@ by2
  1751.   \availdimen@=\pageheight \advance\availdimen@ by-\ht\partialpage
  1752. % If the remaining data is too big for one page,
  1753. % output one page normally, then work with what remains.
  1754.   \ifdim \dimen@>\availdimen@
  1755.    {
  1756.      \splittopskip=\topskip \splitmaxdepth=\maxdepth
  1757.      \dimen@=\pageheight \advance\dimen@ by-\ht\partialpage
  1758.      \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@
  1759.      \onepageout\pagesofar
  1760.    }
  1761. % Recompute size of what remains, in case we just output some of it.
  1762.   \dimen@=\ht255
  1763.   \advance\dimen@ by\topskip \advance\dimen@ by-\baselineskip
  1764.   \divide\dimen@ by2
  1765.   \fi
  1766.   \setbox0=\vbox{\unvbox255}
  1767.   \splittopskip=\topskip
  1768.   {\vbadness=10000 \loop \global\setbox3=\copy0
  1769.     \global\setbox1=\vsplit3 to\dimen@
  1770.     \ifdim\ht3>\dimen@ \global\advance\dimen@ by1pt \repeat}
  1771.   \setbox0=\vbox to\dimen@{\unvbox1}  \setbox2=\vbox to\dimen@{\unvbox3}
  1772.   \pagesofar}
  1773.  
  1774. \catcode `\@=\other
  1775. \message{sectioning,}
  1776. % Define chapters, sections, etc.
  1777.  
  1778. \newcount \chapno
  1779. \newcount \secno        \secno=0
  1780. \newcount \subsecno     \subsecno=0
  1781. \newcount \subsubsecno  \subsubsecno=0
  1782.  
  1783. % This counter is funny since it counts through charcodes of letters A, B, ...
  1784. \newcount \appendixno  \appendixno = `\@
  1785. \def\appendixletter{\char\the\appendixno}
  1786.  
  1787. \newwrite \contentsfile
  1788. % This is called from \setfilename.
  1789. \def\opencontents{\openout \contentsfile = \jobname.toc}
  1790.  
  1791. % Each @chapter defines this as the name of the chapter.
  1792. % page headings and footings can use it.  @section does likewise
  1793.  
  1794. \def\thischapter{} \def\thissection{}
  1795. \def\seccheck#1{\if \pageno<0 %
  1796. \errmessage{@#1 not allowed after generating table of contents}\fi
  1797. %
  1798. }
  1799.  
  1800. \def\chapternofonts{%
  1801. \let\rawbackslash=\relax%
  1802. \let\frenchspacing=\relax%
  1803. \def\result{\realbackslash result}
  1804. \def\equiv{\realbackslash equiv}
  1805. \def\expansion{\realbackslash expansion}
  1806. \def\print{\realbackslash print}
  1807. \def\TeX{\realbackslash TeX}
  1808. \def\dots{\realbackslash dots}
  1809. \def\copyright{\realbackslash copyright}
  1810. \def\tt{\realbackslash tt}
  1811. \def\bf{\realbackslash bf }
  1812. \def\w{\realbackslash w}
  1813. \def\less{\realbackslash less}
  1814. \def\gtr{\realbackslash gtr}
  1815. \def\hat{\realbackslash hat}
  1816. \def\char{\realbackslash char}
  1817. \def\tclose##1{\realbackslash tclose {##1}}
  1818. \def\code##1{\realbackslash code {##1}}
  1819. \def\samp##1{\realbackslash samp {##1}}
  1820. \def\r##1{\realbackslash r {##1}}
  1821. \def\b##1{\realbackslash b {##1}}
  1822. \def\key##1{\realbackslash key {##1}}
  1823. \def\file##1{\realbackslash file {##1}}
  1824. \def\kbd##1{\realbackslash kbd {##1}}
  1825. % These are redefined because @smartitalic wouldn't work inside xdef.
  1826. \def\i##1{\realbackslash i {##1}}
  1827. \def\cite##1{\realbackslash cite {##1}}
  1828. \def\var##1{\realbackslash var {##1}}
  1829. \def\emph##1{\realbackslash emph {##1}}
  1830. \def\dfn##1{\realbackslash dfn {##1}}
  1831. }
  1832.  
  1833. \def\thischaptername{No Chapter Title}
  1834. \outer\def\chapter{\parsearg\chapterzzz}
  1835. \def\chapterzzz #1{\seccheck{chapter}%
  1836. \secno=0 \subsecno=0 \subsubsecno=0
  1837. \global\advance \chapno by 1 \message{Chapter \the\chapno}%
  1838. \chapmacro {#1}{\the\chapno}%
  1839. \gdef\thissection{#1}%
  1840. \gdef\thischaptername{#1}%
  1841. % We don't substitute the actual chapter name into \thischapter
  1842. % because we don't want its macros evaluated now.
  1843. \xdef\thischapter{Chapter \the\chapno: \noexpand\thischaptername}%
  1844. {\chapternofonts%
  1845. \edef\temp{{\realbackslash chapentry {#1}{\the\chapno}{\noexpand\folio}}}%
  1846. \escapechar=`\\%
  1847. \write \contentsfile \temp  %
  1848. \donoderef %
  1849. \global\let\section = \numberedsec
  1850. \global\let\subsection = \numberedsubsec
  1851. \global\let\subsubsection = \numberedsubsubsec
  1852. }}
  1853.  
  1854. \outer\def\appendix{\parsearg\appendixzzz}
  1855. \def\appendixzzz #1{\seccheck{appendix}%
  1856. \secno=0 \subsecno=0 \subsubsecno=0
  1857. \global\advance \appendixno by 1 \message{Appendix \appendixletter}%
  1858. \chapmacro {#1}{Appendix \appendixletter}%
  1859. \gdef\thissection{#1}%
  1860. \gdef\thischaptername{#1}%
  1861. \xdef\thischapter{Appendix \appendixletter: \noexpand\thischaptername}%
  1862. {\chapternofonts%
  1863. \edef\temp{{\realbackslash chapentry 
  1864.   {#1}{Appendix \appendixletter}{\noexpand\folio}}}%
  1865. \escapechar=`\\%
  1866. \write \contentsfile \temp  %
  1867. \appendixnoderef %
  1868. \global\let\section = \appendixsec
  1869. \global\let\subsection = \appendixsubsec
  1870. \global\let\subsubsection = \appendixsubsubsec
  1871. }}
  1872.  
  1873. \outer\def\top{\parsearg\unnumberedzzz}
  1874. \outer\def\unnumbered{\parsearg\unnumberedzzz}
  1875. \def\unnumberedzzz #1{\seccheck{unnumbered}%
  1876. \secno=0 \subsecno=0 \subsubsecno=0
  1877. %
  1878. % If we just use `#1' in the message, it is fully expanded -- and so if
  1879. % it contains @-commands, they will be expanded, and this is not at all
  1880. % what we want.  TeX expands \the\toks only once.
  1881. \toks0 = {#1}\message{(\the\toks0)}%
  1882. %
  1883. \unnumbchapmacro {#1}%
  1884. \gdef\thischapter{#1}\gdef\thissection{#1}%
  1885. {\chapternofonts%
  1886. \edef\temp{{\realbackslash unnumbchapentry {#1}{\noexpand\folio}}}%
  1887. \escapechar=`\\%
  1888. \write \contentsfile \temp  %
  1889. \unnumbnoderef %
  1890. \global\let\section = \unnumberedsec
  1891. \global\let\subsection = \unnumberedsubsec
  1892. \global\let\subsubsection = \unnumberedsubsubsec
  1893. }}
  1894.  
  1895. \outer\def\numberedsec{\parsearg\seczzz}
  1896. \def\seczzz #1{\seccheck{section}%
  1897. \subsecno=0 \subsubsecno=0 \global\advance \secno by 1 %
  1898. \gdef\thissection{#1}\secheading {#1}{\the\chapno}{\the\secno}%
  1899. {\chapternofonts%
  1900. \edef\temp{{\realbackslash secentry %
  1901. {#1}{\the\chapno}{\the\secno}{\noexpand\folio}}}%
  1902. \escapechar=`\\%
  1903. \write \contentsfile \temp %
  1904. \donoderef %
  1905. \penalty 10000 %
  1906. }}
  1907.  
  1908. \outer\def\appendixsection{\parsearg\appendixsectionzzz}
  1909. \outer\def\appendixsec{\parsearg\appendixsectionzzz}
  1910. \def\appendixsectionzzz #1{\seccheck{appendixsection}%
  1911. \subsecno=0 \subsubsecno=0 \global\advance \secno by 1 %
  1912. \gdef\thissection{#1}\secheading {#1}{\appendixletter}{\the\secno}%
  1913. {\chapternofonts%
  1914. \edef\temp{{\realbackslash secentry %
  1915. {#1}{\appendixletter}{\the\secno}{\noexpand\folio}}}%
  1916. \escapechar=`\\%
  1917. \write \contentsfile \temp %
  1918. \appendixnoderef %
  1919. \penalty 10000 %
  1920. }}
  1921.  
  1922. \outer\def\unnumberedsec{\parsearg\unnumberedseczzz}
  1923. \def\unnumberedseczzz #1{\seccheck{unnumberedsec}%
  1924. \plainsecheading {#1}\gdef\thissection{#1}%
  1925. {\chapternofonts%
  1926. \edef\temp{{\realbackslash unnumbsecentry{#1}{\noexpand\folio}}}%
  1927. \escapechar=`\\%
  1928. \write \contentsfile \temp %
  1929. \unnumbnoderef %
  1930. \penalty 10000 %
  1931. }}
  1932.  
  1933. \outer\def\numberedsubsec{\parsearg\numberedsubseczzz}
  1934. \def\numberedsubseczzz #1{\seccheck{subsection}%
  1935. \gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 %
  1936. \subsecheading {#1}{\the\chapno}{\the\secno}{\the\subsecno}%
  1937. {\chapternofonts%
  1938. \edef\temp{{\realbackslash subsecentry %
  1939. {#1}{\the\chapno}{\the\secno}{\the\subsecno}{\noexpand\folio}}}%
  1940. \escapechar=`\\%
  1941. \write \contentsfile \temp %
  1942. \donoderef %
  1943. \penalty 10000 %
  1944. }}
  1945.  
  1946. \outer\def\appendixsubsec{\parsearg\appendixsubseczzz}
  1947. \def\appendixsubseczzz #1{\seccheck{appendixsubsec}%
  1948. \gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 %
  1949. \subsecheading {#1}{\appendixletter}{\the\secno}{\the\subsecno}%
  1950. {\chapternofonts%
  1951. \edef\temp{{\realbackslash subsecentry %
  1952. {#1}{\appendixletter}{\the\secno}{\the\subsecno}{\noexpand\folio}}}%
  1953. \escapechar=`\\%
  1954. \write \contentsfile \temp %
  1955. \appendixnoderef %
  1956. \penalty 10000 %
  1957. }}
  1958.  
  1959. \outer\def\unnumberedsubsec{\parsearg\unnumberedsubseczzz}
  1960. \def\unnumberedsubseczzz #1{\seccheck{unnumberedsubsec}%
  1961. \plainsecheading {#1}\gdef\thissection{#1}%
  1962. {\chapternofonts%
  1963. \edef\temp{{\realbackslash unnumbsubsecentry{#1}{\noexpand\folio}}}%
  1964. \escapechar=`\\%
  1965. \write \contentsfile \temp %
  1966. \unnumbnoderef %
  1967. \penalty 10000 %
  1968. }}
  1969.  
  1970. \outer\def\numberedsubsubsec{\parsearg\numberedsubsubseczzz}
  1971. \def\numberedsubsubseczzz #1{\seccheck{subsubsection}%
  1972. \gdef\thissection{#1}\global\advance \subsubsecno by 1 %
  1973. \subsubsecheading {#1}
  1974.   {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
  1975. {\chapternofonts%
  1976. \edef\temp{{\realbackslash subsubsecentry %
  1977.   {#1}
  1978.   {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}
  1979.   {\noexpand\folio}}}%
  1980. \escapechar=`\\%
  1981. \write \contentsfile \temp %
  1982. \donoderef %
  1983. \penalty 10000 %
  1984. }}
  1985.  
  1986. \outer\def\appendixsubsubsec{\parsearg\appendixsubsubseczzz}
  1987. \def\appendixsubsubseczzz #1{\seccheck{appendixsubsubsec}%
  1988. \gdef\thissection{#1}\global\advance \subsubsecno by 1 %
  1989. \subsubsecheading {#1}
  1990.   {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
  1991. {\chapternofonts%
  1992. \edef\temp{{\realbackslash subsubsecentry{#1}%
  1993.   {\appendixletter}
  1994.   {\the\secno}{\the\subsecno}{\the\subsubsecno}{\noexpand\folio}}}%
  1995. \escapechar=`\\%
  1996. \write \contentsfile \temp %
  1997. \appendixnoderef %
  1998. \penalty 10000 %
  1999. }}
  2000.  
  2001. \outer\def\unnumberedsubsubsec{\parsearg\unnumberedsubsubseczzz}
  2002. \def\unnumberedsubsubseczzz #1{\seccheck{unnumberedsubsubsec}%
  2003. \plainsecheading {#1}\gdef\thissection{#1}%
  2004. {\chapternofonts%
  2005. \edef\temp{{\realbackslash unnumbsubsubsecentry{#1}{\noexpand\folio}}}%
  2006. \escapechar=`\\%
  2007. \write \contentsfile \temp %
  2008. \unnumbnoderef %
  2009. \penalty 10000 %
  2010. }}
  2011.  
  2012. % These are variants which are not "outer", so they can appear in @ifinfo.
  2013. % Actually, they should now be obsolete; ordinary section commands should work.
  2014. \def\infotop{\parsearg\unnumberedzzz}
  2015. \def\infounnumbered{\parsearg\unnumberedzzz}
  2016. \def\infounnumberedsec{\parsearg\unnumberedseczzz}
  2017. \def\infounnumberedsubsec{\parsearg\unnumberedsubseczzz}
  2018. \def\infounnumberedsubsubsec{\parsearg\unnumberedsubsubseczzz}
  2019.  
  2020. \def\infoappendix{\parsearg\appendixzzz}
  2021. \def\infoappendixsec{\parsearg\appendixseczzz}
  2022. \def\infoappendixsubsec{\parsearg\appendixsubseczzz}
  2023. \def\infoappendixsubsubsec{\parsearg\appendixsubsubseczzz}
  2024.  
  2025. \def\infochapter{\parsearg\chapterzzz}
  2026. \def\infosection{\parsearg\sectionzzz}
  2027. \def\infosubsection{\parsearg\subsectionzzz}
  2028. \def\infosubsubsection{\parsearg\subsubsectionzzz}
  2029.  
  2030. % These macros control what the section commands do, according
  2031. % to what kind of chapter we are in (ordinary, appendix, or unnumbered).
  2032. % Define them by default for a numbered chapter.
  2033. \global\let\section = \numberedsec
  2034. \global\let\subsection = \numberedsubsec
  2035. \global\let\subsubsection = \numberedsubsubsec
  2036.  
  2037. % Define @majorheading, @heading and @subheading
  2038.  
  2039. % NOTE on use of \vbox for chapter headings, section headings, and
  2040. % such:
  2041. %    1) We use \vbox rather than the earlier \line to permit
  2042. %       overlong headings to fold.
  2043. %    2) \hyphenpenalty is set to 10000 because hyphenation in a
  2044. %       heading is obnoxious; this forbids it.
  2045. %       3) Likewise, headings look best if no \parindent is used, and
  2046. %          if justification is not attempted.  Hence \raggedright.
  2047.  
  2048.  
  2049. \def\majorheading{\parsearg\majorheadingzzz}
  2050. \def\majorheadingzzz #1{%
  2051. {\advance\chapheadingskip by 10pt \chapbreak }%
  2052. {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
  2053.                   \parindent=0pt\raggedright
  2054.                   \rm #1\hfill}}\bigskip \par\penalty 200}
  2055.  
  2056. \def\chapheading{\parsearg\chapheadingzzz}
  2057. \def\chapheadingzzz #1{\chapbreak %
  2058. {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
  2059.                   \parindent=0pt\raggedright
  2060.                   \rm #1\hfill}}\bigskip \par\penalty 200}
  2061.  
  2062. \def\heading{\parsearg\secheadingi}
  2063.  
  2064. \def\subheading{\parsearg\subsecheadingi}
  2065.  
  2066. \def\subsubheading{\parsearg\subsubsecheadingi}
  2067.  
  2068. % These macros generate a chapter, section, etc. heading only
  2069. % (including whitespace, linebreaking, etc. around it),
  2070. % given all the information in convenient, parsed form.
  2071.  
  2072. %%% Args are the skip and penalty (usually negative)
  2073. \def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi}
  2074.  
  2075. \def\setchapterstyle #1 {\csname CHAPF#1\endcsname}
  2076.  
  2077. %%% Define plain chapter starts, and page on/off switching for it
  2078. % Parameter controlling skip before chapter headings (if needed)
  2079.  
  2080. \newskip \chapheadingskip \chapheadingskip = 30pt plus 8pt minus 4pt
  2081.  
  2082. \def\chapbreak{\dobreak \chapheadingskip {-4000}}
  2083. \def\chappager{\par\vfill\supereject}
  2084. \def\chapoddpage{\chappager \ifodd\pageno \else \hbox to 0pt{} \chappager\fi}
  2085.  
  2086. \def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname}
  2087.  
  2088. \def\CHAPPAGoff{
  2089. \global\let\pchapsepmacro=\chapbreak
  2090. \global\let\pagealignmacro=\chappager}
  2091.  
  2092. \def\CHAPPAGon{
  2093. \global\let\pchapsepmacro=\chappager
  2094. \global\let\pagealignmacro=\chappager
  2095. \global\def\HEADINGSon{\HEADINGSsingle}}
  2096.  
  2097. \def\CHAPPAGodd{
  2098. \global\let\pchapsepmacro=\chapoddpage
  2099. \global\let\pagealignmacro=\chapoddpage
  2100. \global\def\HEADINGSon{\HEADINGSdouble}}
  2101.  
  2102. \CHAPPAGon
  2103.  
  2104. \def\CHAPFplain{
  2105. \global\let\chapmacro=\chfplain
  2106. \global\let\unnumbchapmacro=\unnchfplain}
  2107.  
  2108. \def\chfplain #1#2{%
  2109.   \pchapsepmacro
  2110.   {%
  2111.     \chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
  2112.                      \parindent=0pt\raggedright
  2113.                      \rm #2\enspace #1}%
  2114.   }%
  2115.   \bigskip
  2116.   \penalty5000
  2117. }
  2118.  
  2119. \def\unnchfplain #1{%
  2120. \pchapsepmacro %
  2121. {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
  2122.                   \parindent=0pt\raggedright
  2123.                   \rm #1\hfill}}\bigskip \par\penalty 10000 %
  2124. }
  2125. \CHAPFplain % The default
  2126.  
  2127. \def\unnchfopen #1{%
  2128. \chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
  2129.                        \parindent=0pt\raggedright
  2130.                        \rm #1\hfill}}\bigskip \par\penalty 10000 %
  2131. }
  2132.  
  2133. \def\chfopen #1#2{\chapoddpage {\chapfonts
  2134. \vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}%
  2135. \par\penalty 5000 %
  2136. }
  2137.  
  2138. \def\CHAPFopen{
  2139. \global\let\chapmacro=\chfopen
  2140. \global\let\unnumbchapmacro=\unnchfopen}
  2141.  
  2142. % Parameter controlling skip before section headings.
  2143.  
  2144. \newskip \subsecheadingskip  \subsecheadingskip = 17pt plus 8pt minus 4pt
  2145. \def\subsecheadingbreak{\dobreak \subsecheadingskip {-500}}
  2146.  
  2147. \newskip \secheadingskip  \secheadingskip = 21pt plus 8pt minus 4pt
  2148. \def\secheadingbreak{\dobreak \secheadingskip {-1000}}
  2149.  
  2150. % @paragraphindent  is defined for the Info formatting commands only.
  2151. \let\paragraphindent=\comment
  2152.  
  2153. % Section fonts are the base font at magstep2, which produces
  2154. % a size a bit more than 14 points in the default situation.    
  2155.  
  2156. \def\secheading #1#2#3{\secheadingi {#2.#3\enspace #1}}
  2157. \def\plainsecheading #1{\secheadingi {#1}}
  2158. \def\secheadingi #1{{\advance \secheadingskip by \parskip %
  2159. \secheadingbreak}%
  2160. {\secfonts \vbox{\hyphenpenalty=10000\tolerance=5000
  2161.                  \parindent=0pt\raggedright
  2162.                  \rm #1\hfill}}%
  2163. \ifdim \parskip<10pt \kern 10pt\kern -\parskip\fi \penalty 10000 }
  2164.  
  2165.  
  2166. % Subsection fonts are the base font at magstep1, 
  2167. % which produces a size of 12 points.
  2168.  
  2169. \def\subsecheading #1#2#3#4{\subsecheadingi {#2.#3.#4\enspace #1}}
  2170. \def\subsecheadingi #1{{\advance \subsecheadingskip by \parskip %
  2171. \subsecheadingbreak}%
  2172. {\subsecfonts \vbox{\hyphenpenalty=10000\tolerance=5000
  2173.                      \parindent=0pt\raggedright
  2174.                      \rm #1\hfill}}%
  2175. \ifdim \parskip<10pt \kern 10pt\kern -\parskip\fi \penalty 10000 }
  2176.  
  2177. \def\subsubsecfonts{\subsecfonts} % Maybe this should change:
  2178.                   % Perhaps make sssec fonts scaled
  2179.                   % magstep half
  2180. \def\subsubsecheading #1#2#3#4#5{\subsubsecheadingi {#2.#3.#4.#5\enspace #1}}
  2181. \def\subsubsecheadingi #1{{\advance \subsecheadingskip by \parskip %
  2182. \subsecheadingbreak}%
  2183. {\subsubsecfonts \vbox{\hyphenpenalty=10000\tolerance=5000
  2184.                        \parindent=0pt\raggedright
  2185.                        \rm #1\hfill}}%
  2186. \ifdim \parskip<10pt \kern 10pt\kern -\parskip\fi \penalty 10000}
  2187.  
  2188.  
  2189. \message{toc printing,}
  2190.  
  2191. % Finish up the main text and prepare to read what we've written
  2192. % to \contentsfile.
  2193.  
  2194. \newskip\contentsrightmargin \contentsrightmargin=1in
  2195. \def\startcontents#1{%
  2196.    \pagealignmacro
  2197.    \immediate\closeout \contentsfile
  2198.    \ifnum \pageno>0
  2199.       \pageno = -1        % Request roman numbered pages.
  2200.    \fi
  2201.    % Don't need to put `Contents' or `Short Contents' in the headline. 
  2202.    % It is abundantly clear what they are.
  2203.    \unnumbchapmacro{#1}\def\thischapter{}%
  2204.    \begingroup           % Set up to handle contents files properly.
  2205.       \catcode`\\=0  \catcode`\{=1  \catcode`\}=2  \catcode`\@=11
  2206.       \raggedbottom             % Worry more about breakpoints than the bottom.
  2207.       \advance\hsize by -\contentsrightmargin % Don't use the full line length.
  2208. }
  2209.  
  2210.   
  2211. % Normal (long) toc.
  2212. \outer\def\contents{%
  2213.    \startcontents{Table of Contents}%
  2214.       \input \jobname.toc
  2215.    \endgroup
  2216.    \vfill \eject
  2217. }
  2218.  
  2219. % And just the chapters.
  2220. \outer\def\summarycontents{%
  2221.    \startcontents{Short Contents}%
  2222.       %
  2223.       \let\chapentry = \shortchapentry
  2224.       \let\unnumbchapentry = \shortunnumberedentry
  2225.       % We want a true roman here for the page numbers.
  2226.       \secfonts
  2227.       \let\rm=\shortcontrm \let\bf=\shortcontbf \let\sl=\shortcontsl
  2228.       \rm
  2229.       \advance\baselineskip by 1pt % Open it up a little.
  2230.       \def\secentry ##1##2##3##4{}
  2231.       \def\unnumbsecentry ##1##2{}
  2232.       \def\subsecentry ##1##2##3##4##5{}
  2233.       \def\unnumbsubsecentry ##1##2{}
  2234.       \def\subsubsecentry ##1##2##3##4##5##6{}
  2235.       \def\unnumbsubsubsecentry ##1##2{}
  2236.       \input \jobname.toc
  2237.    \endgroup
  2238.    \vfill \eject
  2239. }
  2240. \let\shortcontents = \summarycontents
  2241.  
  2242. % These macros generate individual entries in the table of contents.
  2243. % The first argument is the chapter or section name.
  2244. % The last argument is the page number.
  2245. % The arguments in between are the chapter number, section number, ...
  2246.  
  2247. % Chapter-level things, for both the long and short contents.
  2248. \def\chapentry#1#2#3{\dochapentry{#2\labelspace#1}{#3}}
  2249.  
  2250. % See comments in \dochapentry re vbox and related settings
  2251. \def\shortchapentry#1#2#3{%
  2252.   \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno{#3}}%
  2253. }
  2254.  
  2255. % Typeset the label for a chapter or appendix for the short contents.
  2256. % The arg is, e.g. `Appendix A' for an appendix, or `3' for a chapter.
  2257. % We could simplify the code here by writing out an \appendixentry
  2258. % command in the toc file for appendices, instead of using \chapentry
  2259. % for both, but it doesn't seem worth it.
  2260. \setbox0 = \hbox{\shortcontrm Appendix }
  2261. \newdimen\shortappendixwidth \shortappendixwidth = \wd0
  2262.  
  2263. \def\shortchaplabel#1{%
  2264.   % We typeset #1 in a box of constant width, regardless of the text of
  2265.   % #1, so the chapter titles will come out aligned.
  2266.   \setbox0 = \hbox{#1}%
  2267.   \dimen0 = \ifdim\wd0 > \shortappendixwidth \shortappendixwidth \else 0pt \fi
  2268.   %
  2269.   % This space should be plenty, since a single number is .5em, and the
  2270.   % widest letter (M) is 1em, at least in the Computer Modern fonts.
  2271.   % (This space doesn't include the extra space that gets added after
  2272.   % the label; that gets put in in \shortchapentry above.)
  2273.   \advance\dimen0 by 1.1em
  2274.   \hbox to \dimen0{#1\hfil}%
  2275. }
  2276.  
  2277. \def\unnumbchapentry#1#2{\dochapentry{#1}{#2}}
  2278. \def\shortunnumberedentry#1#2{\tocentry{#1}{\doshortpageno{#2}}}
  2279.  
  2280. % Sections.
  2281. \def\secentry#1#2#3#4{\dosecentry{#2.#3\labelspace#1}{#4}}
  2282. \def\unnumbsecentry#1#2{\dosecentry{#1}{#2}}
  2283.  
  2284. % Subsections.
  2285. \def\subsecentry#1#2#3#4#5{\dosubsecentry{#2.#3.#4\labelspace#1}{#5}}
  2286. \def\unnumbsubsecentry#1#2{\dosubsecentry{#1}{#2}}
  2287.  
  2288. % And subsubsections.
  2289. \def\subsubsecentry#1#2#3#4#5#6{%
  2290.   \dosubsubsecentry{#2.#3.#4.#5\labelspace#1}{#6}}
  2291. \def\unnumbsubsubsecentry#1#2{\dosubsubsecentry{#1}{#2}}
  2292.  
  2293.  
  2294. % This parameter controls the indentation of the various levels.
  2295. \newdimen\tocindent \tocindent = 3pc
  2296.  
  2297. % Now for the actual typesetting. In all these, #1 is the text and #2 is the 
  2298. % page number.
  2299. %
  2300. % If the toc has to be broken over pages, we would want to be at chapters 
  2301. % if at all possible; hence the \penalty.
  2302. \def\dochapentry#1#2{%
  2303.    \penalty-300 \vskip\baselineskip
  2304.    \begingroup
  2305.      \chapentryfonts
  2306.      \tocentry{#1}{\dopageno{#2}}%
  2307.    \endgroup
  2308.    \nobreak\vskip .25\baselineskip
  2309. }
  2310.  
  2311. \def\dosecentry#1#2{\begingroup
  2312.   \secentryfonts \leftskip=\tocindent
  2313.   \tocentry{#1}{\dopageno{#2}}%
  2314. \endgroup}
  2315.  
  2316. \def\dosubsecentry#1#2{\begingroup
  2317.   \subsecentryfonts \leftskip=2\tocindent
  2318.   \tocentry{#1}{\dopageno{#2}}%
  2319. \endgroup}
  2320.  
  2321. \def\dosubsubsecentry#1#2{\begingroup
  2322.   \subsubsecentryfonts \leftskip=3\tocindent
  2323.   \tocentry{#1}{\dopageno{#2}}%
  2324. \endgroup}
  2325.  
  2326. % Final typesetting of a toc entry; we use the same \entry macro as for
  2327. % the index entries, but we want to suppress hyphenation here.  (We
  2328. % can't do that in the \entry macro, since index entries might consist
  2329. % of hyphenated-identifiers-that-do-not-fit-on-a-line-and-nothing-else.)
  2330. \def\tocentry#1#2{\begingroup
  2331.   \hyphenpenalty = 10000
  2332.   \entry{#1}{#2}%
  2333. \endgroup}
  2334.  
  2335. % Space between chapter (or whatever) number and the title.
  2336. \def\labelspace{\hskip1em \relax}
  2337.  
  2338. \def\dopageno#1{{\rm #1}}
  2339. \def\doshortpageno#1{{\rm #1}}
  2340.  
  2341. \def\chapentryfonts{\secfonts \rm}
  2342. \def\secentryfonts{\textfonts}
  2343. \let\subsecentryfonts = \textfonts
  2344. \let\subsubsecentryfonts = \textfonts
  2345.  
  2346.  
  2347. \message{environments,}
  2348.  
  2349. % Since these characters are used in examples, it should be an even number of 
  2350. % \tt widths. Each \tt character is 1en, so two makes it 1em.
  2351. % Furthermore, these definitions must come after we define our fonts.
  2352. \newbox\dblarrowbox    \newbox\longdblarrowbox
  2353. \newbox\pushcharbox    \newbox\bullbox
  2354. \newbox\equivbox       \newbox\errorbox
  2355.  
  2356. \let\ptexequiv = \equiv
  2357.  
  2358. %{\tentt
  2359. %\global\setbox\dblarrowbox = \hbox to 1em{\hfil$\Rightarrow$\hfil}
  2360. %\global\setbox\longdblarrowbox = \hbox to 1em{\hfil$\mapsto$\hfil}
  2361. %\global\setbox\pushcharbox = \hbox to 1em{\hfil$\dashv$\hfil}
  2362. %\global\setbox\equivbox = \hbox to 1em{\hfil$\ptexequiv$\hfil}
  2363. % Adapted from the manmac format (p.420 of TeXbook)
  2364. %\global\setbox\bullbox = \hbox to 1em{\kern.15em\vrule height .75ex width .85ex
  2365. %                                      depth .1ex\hfil}
  2366. %}
  2367.  
  2368. \def\point{$\star$}
  2369.  
  2370. \def\result{\leavevmode\raise.15ex\hbox to 1em{\hfil$\Rightarrow$\hfil}}
  2371. \def\expansion{\leavevmode\raise.1ex\hbox to 1em{\hfil$\mapsto$\hfil}}
  2372. \def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}}
  2373.  
  2374. \def\equiv{\leavevmode\lower.1ex\hbox to 1em{\hfil$\ptexequiv$\hfil}}
  2375.  
  2376. % Adapted from the TeXbook's \boxit.
  2377. {\tentt \global\dimen0 = 3em}% Width of the box.
  2378. \dimen2 = .55pt % Thickness of rules
  2379. % The text. (`r' is open on the right, `e' somewhat less so on the left.)
  2380. \setbox0 = \hbox{\kern-.75pt \tensf error\kern-1.5pt}
  2381.  
  2382. \global\setbox\errorbox=\hbox to \dimen0{\hfil
  2383.    \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right.
  2384.    \advance\hsize by -2\dimen2 % Rules.
  2385.    \vbox{
  2386.       \hrule height\dimen2
  2387.       \hbox{\vrule width\dimen2 \kern3pt          % Space to left of text.
  2388.          \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below.
  2389.          \kern3pt\vrule width\dimen2}% Space to right.
  2390.       \hrule height\dimen2}
  2391.     \hfil}
  2392.  
  2393. % The @error{} command.
  2394. \def\error{\leavevmode\lower.7ex\copy\errorbox}
  2395.  
  2396. % @tex ... @end tex    escapes into raw Tex temporarily.
  2397. % One exception: @ is still an escape character, so that @end tex works.
  2398. % But \@ or @@ will get a plain tex @ character.
  2399.  
  2400. \def\tex{\begingroup
  2401. \catcode `\\=0 \catcode `\{=1 \catcode `\}=2
  2402. \catcode `\$=3 \catcode `\&=4 \catcode `\#=6
  2403. \catcode `\^=7 \catcode `\_=8 \catcode `\~=13 \let~=\tie
  2404. \catcode `\%=14
  2405. \catcode 43=12
  2406. \catcode`\"=12
  2407. \catcode`\==12
  2408. \catcode`\|=12
  2409. \catcode`\<=12
  2410. \catcode`\>=12
  2411. \escapechar=`\\
  2412. %
  2413. \let\{=\ptexlbrace
  2414. \let\}=\ptexrbrace
  2415. \let\.=\ptexdot
  2416. \let\*=\ptexstar
  2417. \let\dots=\ptexdots
  2418. \def\@{@}%
  2419. \let\bullet=\ptexbullet
  2420. \let\b=\ptexb \let\c=\ptexc \let\i=\ptexi \let\t=\ptext \let\l=\ptexl
  2421. \let\L=\ptexL
  2422. %
  2423. \let\Etex=\endgroup}
  2424.  
  2425. % Define @lisp ... @endlisp.
  2426. % @lisp does a \begingroup so it can rebind things,
  2427. % including the definition of @endlisp (which normally is erroneous).
  2428.  
  2429. % Amount to narrow the margins by for @lisp.
  2430. \newskip\lispnarrowing \lispnarrowing=0.4in
  2431.  
  2432. % This is the definition that ^M gets inside @lisp
  2433. % phr: changed space to \null, to avoid overfull hbox problems.
  2434. {\obeyspaces%
  2435. \gdef\lisppar{\null\endgraf}}
  2436.  
  2437. % Cause \obeyspaces to make each Space cause a word-separation
  2438. % rather than the default which is that it acts punctuation.
  2439. % This is because space in tt font looks funny.
  2440. {\obeyspaces %
  2441. \gdef\sepspaces{\def {\ }}}
  2442.  
  2443. % This space is always present above and below environments.
  2444. \newskip\envskipamount \envskipamount = 0pt
  2445.  
  2446. % Make spacing and below environment symmetrical.
  2447. \def\aboveenvbreak{{\advance\envskipamount by \parskip
  2448. \endgraf \ifdim\lastskip<\envskipamount
  2449. \removelastskip \penalty-50 \vskip\envskipamount \fi}}
  2450.  
  2451. \let\afterenvbreak = \aboveenvbreak
  2452.  
  2453. % \nonarrowing is a flag.  If "set", @lisp etc don't narrow margins.
  2454. \let\nonarrowing=\relax
  2455.  
  2456. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  2457. % \cartouche: draw rectangle w/rounded corners around argument
  2458. \font\circle=lcircle10
  2459. \newdimen\circthick
  2460. \newdimen\cartouter\newdimen\cartinner
  2461. \newskip\normbskip\newskip\normpskip\newskip\normlskip
  2462. \circthick=\fontdimen8\circle
  2463. %
  2464. \def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth
  2465. \def\ctr{{\hskip 6pt\circle\char'010}}
  2466. \def\cbl{{\circle\char'012\hskip -6pt}}
  2467. \def\cbr{{\hskip 6pt\circle\char'011}}
  2468. \def\carttop{\hbox to \cartouter{\hskip\lskip
  2469.     \ctl\leaders\hrule height\circthick\hfil\ctr
  2470.     \hskip\rskip}}
  2471. \def\cartbot{\hbox to \cartouter{\hskip\lskip
  2472.     \cbl\leaders\hrule height\circthick\hfil\cbr
  2473.     \hskip\rskip}}
  2474. %
  2475. \newskip\lskip\newskip\rskip
  2476.  
  2477. \long\def\cartouche{%
  2478. \begingroup
  2479.     \lskip=\leftskip \rskip=\rightskip
  2480.     \leftskip=0pt\rightskip=0pt %we want these *outside*.
  2481.     \cartinner=\hsize \advance\cartinner by-\lskip 
  2482.                \advance\cartinner by-\rskip
  2483.     \cartouter=\hsize
  2484.     \advance\cartouter by 18pt % allow for 3pt kerns on either
  2485. %                     side, and for 6pt waste from
  2486. %                     each corner char
  2487.     \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip
  2488.     % Flag to tell @lisp, etc., not to narrow margin.
  2489.     \let\nonarrowing=\comment
  2490.     \vbox\bgroup
  2491.         \baselineskip=0pt\parskip=0pt\lineskip=0pt
  2492.         \carttop
  2493.         \hbox\bgroup
  2494.             \hskip\lskip
  2495.             \vrule\kern3pt
  2496.             \vbox\bgroup
  2497.                 \hsize=\cartinner
  2498.                 \kern3pt
  2499.                 \begingroup
  2500.                     \baselineskip=\normbskip
  2501.                     \lineskip=\normlskip
  2502.                     \parskip=\normpskip
  2503.                     \vskip -\parskip
  2504. \def\Ecartouche{%
  2505.                 \endgroup
  2506.                 \kern3pt
  2507.             \egroup
  2508.             \kern3pt\vrule
  2509.             \hskip\rskip
  2510.         \egroup
  2511.         \cartbot
  2512.     \egroup
  2513. \endgroup
  2514. }}    
  2515.  
  2516. \def\lisp{\aboveenvbreak
  2517. \begingroup\inENV % This group ends at the end of the @lisp body
  2518. \hfuzz=12truept % Don't be fussy
  2519. % Make spaces be word-separators rather than space tokens.
  2520. \sepspaces %
  2521. % Single space lines
  2522. \singlespace %
  2523. % The following causes blank lines not to be ignored
  2524. % by adding a space to the end of each line.
  2525. \let\par=\lisppar
  2526. \def\Elisp{\endgroup\afterenvbreak}%
  2527. \parskip=0pt
  2528. % @cartouche defines \nonarrowing to inhibit narrowing
  2529. % at next level down.
  2530. \ifx\nonarrowing\relax
  2531. \advance \leftskip by \lispnarrowing
  2532. \exdentamount=\lispnarrowing
  2533. \let\exdent=\nofillexdent
  2534. \let\nonarrowing=\relax
  2535. \fi
  2536. \parindent=0pt
  2537. \obeyspaces \obeylines \tt \rawbackslash
  2538. \gobble
  2539. }
  2540.  
  2541. % Define the \E... control sequence only if we are inside the
  2542. % environment, so the error checking in \end will work.
  2543. % We must call \lisp last in the definition, since it reads the
  2544. % return following the @example (or whatever) command.
  2545. %
  2546. \def\example{\begingroup \def\Eexample{\Elisp\endgroup}\lisp}
  2547. \def\smallexample{\begingroup \def\Esmallexample{\Elisp\endgroup}\lisp}
  2548.  
  2549. % Macro for 9 pt. examples, necessary to print with 5" lines.
  2550. % From Pavel@xerox.  This is not really used unless the
  2551. % @smallbook command is given.
  2552.  
  2553. \def\smalllispx{\aboveenvbreak\begingroup\inENV
  2554. %            This group ends at the end of the @lisp body
  2555. \hfuzz=12truept % Don't be fussy
  2556. % Make spaces be word-separators rather than space tokens.
  2557. \sepspaces %
  2558. % Single space lines
  2559. \singlespace %
  2560. % The following causes blank lines not to be ignored
  2561. % by adding a space to the end of each line.
  2562. \let\par=\lisppar
  2563. \def\Esmalllisp{\endgroup\afterenvbreak}%
  2564. %%%% Smaller baseline skip for small examples.
  2565. \baselineskip 10pt
  2566. \parskip=0pt
  2567. % @cartouche defines \nonarrowing to inhibit narrowing
  2568. % at next level down.
  2569. \ifx\nonarrowing\relax
  2570. \advance \leftskip by \lispnarrowing
  2571. \exdentamount=\lispnarrowing
  2572. \let\exdent=\nofillexdent
  2573. \let\nonarrowing=\relax
  2574. \fi
  2575. \parindent=0pt
  2576. \obeyspaces \obeylines \ninett \indexfonts \rawbackslash
  2577. \def\next##1{}\next}
  2578.  
  2579. % This is @display; same as @lisp except use roman font.
  2580.  
  2581. \def\display{\begingroup\inENV %This group ends at the end of the @display body
  2582. \aboveenvbreak
  2583. % Make spaces be word-separators rather than space tokens.
  2584. \sepspaces %
  2585. % Single space lines
  2586. \singlespace %
  2587. % The following causes blank lines not to be ignored
  2588. % by adding a space to the end of each line.
  2589. \let\par=\lisppar
  2590. \def\Edisplay{\endgroup\afterenvbreak}%
  2591. \parskip=0pt
  2592. % @cartouche defines \nonarrowing to inhibit narrowing
  2593. % at next level down.
  2594. \ifx\nonarrowing\relax
  2595. \advance \leftskip by \lispnarrowing
  2596. \exdentamount=\lispnarrowing
  2597. \let\exdent=\nofillexdent
  2598. \let\nonarrowing=\relax
  2599. \fi
  2600. \parindent=0pt
  2601. \obeyspaces \obeylines
  2602. \def\next##1{}\next}
  2603.  
  2604. % This is @format; same as @lisp except use roman font and don't narrow margins
  2605.  
  2606. \def\format{\begingroup\inENV %This group ends at the end of the @format body
  2607. \aboveenvbreak
  2608. % Make spaces be word-separators rather than space tokens.
  2609. \sepspaces %
  2610. \singlespace %
  2611. % The following causes blank lines not to be ignored
  2612. % by adding a space to the end of each line.
  2613. \let\par=\lisppar
  2614. \def\Eformat{\endgroup\afterenvbreak}
  2615. \parskip=0pt \parindent=0pt
  2616. \obeyspaces \obeylines
  2617. \def\next##1{}\next}
  2618.  
  2619. % @flushleft and @flushright
  2620.  
  2621. \def\flushleft{%
  2622. \begingroup\inENV %This group ends at the end of the @format body
  2623. \aboveenvbreak
  2624. % Make spaces be word-separators rather than space tokens.
  2625. \sepspaces %
  2626. % The following causes blank lines not to be ignored
  2627. % by adding a space to the end of each line.
  2628. % This also causes @ to work when the directive name
  2629. % is terminated by end of line.
  2630. \let\par=\lisppar
  2631. \def\Eflushleft{\endgroup\afterenvbreak}%
  2632. \parskip=0pt \parindent=0pt
  2633. \obeyspaces \obeylines
  2634. \def\next##1{}\next}
  2635.  
  2636. \def\flushright{%
  2637. \begingroup\inENV %This group ends at the end of the @format body
  2638. \aboveenvbreak
  2639. % Make spaces be word-separators rather than space tokens.
  2640. \sepspaces %
  2641. % The following causes blank lines not to be ignored
  2642. % by adding a space to the end of each line.
  2643. % This also causes @ to work when the directive name
  2644. % is terminated by end of line.
  2645. \let\par=\lisppar
  2646. \def\Eflushright{\endgroup\afterenvbreak}%
  2647. \parskip=0pt \parindent=0pt
  2648. \advance \leftskip by 0pt plus 1fill
  2649. \obeyspaces \obeylines
  2650. \def\next##1{}\next}
  2651.  
  2652. % @quotation - narrow the margins.
  2653.  
  2654. \def\quotation{%
  2655. \begingroup\inENV %This group ends at the end of the @quotation body
  2656. {\parskip=0pt  % because we will skip by \parskip too, later
  2657. \aboveenvbreak}%
  2658. \singlespace
  2659. \parindent=0pt
  2660. \def\Equotation{\par\endgroup\afterenvbreak}%
  2661. % @cartouche defines \nonarrowing to inhibit narrowing
  2662. % at next level down.
  2663. \ifx\nonarrowing\relax
  2664. \advance \leftskip by \lispnarrowing
  2665. \advance \rightskip by \lispnarrowing
  2666. \exdentamount=\lispnarrowing
  2667. \let\nonarrowing=\relax
  2668. \fi}
  2669.  
  2670. \message{defuns,}
  2671. % Define formatter for defuns
  2672. % First, allow user to change definition object font (\df) internally
  2673. \def\setdeffont #1 {\csname DEF#1\endcsname}
  2674.  
  2675. \newskip\defbodyindent \defbodyindent=.4in
  2676. \newskip\defargsindent \defargsindent=50pt
  2677. \newskip\deftypemargin \deftypemargin=12pt
  2678. \newskip\deflastargmargin \deflastargmargin=18pt
  2679.  
  2680. \newcount\parencount
  2681. % define \functionparens, which makes ( and ) and & do special things.
  2682. % \functionparens affects the group it is contained in.
  2683. \def\activeparens{%
  2684. \catcode`\(=\active \catcode`\)=\active \catcode`\&=\active
  2685. \catcode`\[=\active \catcode`\]=\active}
  2686.  
  2687. % Make control sequences which act like normal parenthesis chars.
  2688. \let\lparen = ( \let\rparen = )
  2689.  
  2690. {\activeparens % Now, smart parens don't turn on until &foo (see \amprm)
  2691.  
  2692. % Be sure that we always have a definition for `(', etc.  For example,
  2693. % if the fn name has parens in it, \boldbrax will not be in effect yet,
  2694. % so TeX would otherwise complain about undefined control sequence.
  2695. \global\let(=\lparen \global\let)=\rparen
  2696. \global\let[=\lbrack \global\let]=\rbrack
  2697.  
  2698. \gdef\functionparens{\boldbrax\let&=\amprm\parencount=0 }
  2699. \gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb}
  2700.  
  2701. % Definitions of (, ) and & used in args for functions.
  2702. % This is the definition of ( outside of all parentheses.
  2703. \gdef\oprm#1 {{\rm\char`\(}#1 \bf \let(=\opnested %
  2704. \global\advance\parencount by 1 }
  2705. %
  2706. % This is the definition of ( when already inside a level of parens.
  2707. \gdef\opnested{\char`\(\global\advance\parencount by 1 }
  2708. %
  2709. \gdef\clrm{% Print a paren in roman if it is taking us back to depth of 0.
  2710. % also in that case restore the outer-level definition of (.
  2711. \ifnum \parencount=1 {\rm \char `\)}\sl \let(=\oprm \else \char `\) \fi
  2712. \global\advance \parencount by -1 }
  2713. % If we encounter &foo, then turn on ()-hacking afterwards
  2714. \gdef\amprm#1 {{\rm\}\let(=\oprm \let)=\clrm\ }
  2715. %
  2716. \gdef\normalparens{\boldbrax\let&=\ampnr}
  2717. } % End of definition inside \activeparens
  2718. %% These parens (in \boldbrax) actually are a little bolder than the
  2719. %% contained text.  This is especially needed for [ and ]
  2720. \def\opnr{{\sf\char`\(}} \def\clnr{{\sf\char`\)}} \def\ampnr{\&}
  2721. \def\lbrb{{\bf\char`\[}} \def\rbrb{{\bf\char`\]}}
  2722.  
  2723. % First, defname, which formats the header line itself.
  2724. % #1 should be the function name.
  2725. % #2 should be the type of definition, such as "Function".
  2726.  
  2727. \def\defname #1#2{%
  2728. % Get the values of \leftskip and \rightskip as they were
  2729. % outside the @def...
  2730. \dimen2=\leftskip
  2731. \advance\dimen2 by -\defbodyindent
  2732. \dimen3=\rightskip
  2733. \advance\dimen3 by -\defbodyindent
  2734. \noindent        %
  2735. \setbox0=\hbox{\hskip \deflastargmargin{\rm #2}\hskip \deftypemargin}%
  2736. \dimen0=\hsize \advance \dimen0 by -\wd0 % compute size for first line
  2737. \dimen1=\hsize \advance \dimen1 by -\defargsindent %size for continuations
  2738. \parshape 2 0in \dimen0 \defargsindent \dimen1     %
  2739. % Now output arg 2 ("Function" or some such)
  2740. % ending at \deftypemargin from the right margin,
  2741. % but stuck inside a box of width 0 so it does not interfere with linebreaking
  2742. {% Adjust \hsize to exclude the ambient margins,
  2743. % so that \rightline will obey them.
  2744. \advance \hsize by -\dimen2 \advance \hsize by -\dimen3
  2745. \rlap{\rightline{{\rm #2}\hskip \deftypemargin}}}%
  2746. % Make all lines underfull and no complaints:
  2747. \tolerance=10000 \hbadness=10000    
  2748. \advance\leftskip by -\defbodyindent
  2749. \exdentamount=\defbodyindent
  2750. {\df #1}\enskip        % Generate function name
  2751. }
  2752.  
  2753. % Actually process the body of a definition
  2754. % #1 should be the terminating control sequence, such as \Edefun.
  2755. % #2 should be the "another name" control sequence, such as \defunx.
  2756. % #3 should be the control sequence that actually processes the header,
  2757. %    such as \defunheader.
  2758.  
  2759. \def\defparsebody #1#2#3{\begingroup\inENV% Environment for definitionbody
  2760. \medbreak %
  2761. % Define the end token that this defining construct specifies
  2762. % so that it will exit this group.
  2763. \def#1{\endgraf\endgroup\medbreak}%
  2764. \def#2{\begingroup\obeylines\activeparens\spacesplit#3}%
  2765. \parindent=0in
  2766. \advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
  2767. \exdentamount=\defbodyindent
  2768. \begingroup %
  2769. \catcode 61=\active %
  2770. \obeylines\activeparens\spacesplit#3}
  2771.  
  2772. \def\defmethparsebody #1#2#3#4 {\begingroup\inENV %
  2773. \medbreak %
  2774. % Define the end token that this defining construct specifies
  2775. % so that it will exit this group.
  2776. \def#1{\endgraf\endgroup\medbreak}%
  2777. \def#2##1 {\begingroup\obeylines\activeparens\spacesplit{#3{##1}}}%
  2778. \parindent=0in
  2779. \advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
  2780. \exdentamount=\defbodyindent
  2781. \begingroup\obeylines\activeparens\spacesplit{#3{#4}}}
  2782.  
  2783. \def\defopparsebody #1#2#3#4#5 {\begingroup\inENV %
  2784. \medbreak %
  2785. % Define the end token that this defining construct specifies
  2786. % so that it will exit this group.
  2787. \def#1{\endgraf\endgroup\medbreak}%
  2788. \def#2##1 ##2 {\def#4{##1}%
  2789. \begingroup\obeylines\activeparens\spacesplit{#3{##2}}}%
  2790. \parindent=0in
  2791. \advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
  2792. \exdentamount=\defbodyindent
  2793. \begingroup\obeylines\activeparens\spacesplit{#3{#5}}}
  2794.  
  2795. % These parsing functions are similar to the preceding ones
  2796. % except that they do not make parens into active characters.
  2797. % These are used for "variables" since they have no arguments.
  2798.  
  2799. \def\defvarparsebody #1#2#3{\begingroup\inENV% Environment for definitionbody
  2800. \medbreak %
  2801. % Define the end token that this defining construct specifies
  2802. % so that it will exit this group.
  2803. \def#1{\endgraf\endgroup\medbreak}%
  2804. \def#2{\begingroup\obeylines\spacesplit#3}%
  2805. \parindent=0in
  2806. \advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
  2807. \exdentamount=\defbodyindent
  2808. \begingroup %
  2809. \catcode 61=\active %
  2810. \obeylines\spacesplit#3}
  2811.  
  2812. \def\defvrparsebody #1#2#3#4 {\begingroup\inENV %
  2813. \medbreak %
  2814. % Define the end token that this defining construct specifies
  2815. % so that it will exit this group.
  2816. \def#1{\endgraf\endgroup\medbreak}%
  2817. \def#2##1 {\begingroup\obeylines\spacesplit{#3{##1}}}%
  2818. \parindent=0in
  2819. \advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
  2820. \exdentamount=\defbodyindent
  2821. \begingroup\obeylines\spacesplit{#3{#4}}}
  2822.  
  2823. % This is the same as all the others except for the last line.  We need
  2824. % to parse the arguments differently for @deftp, since the ``attributes''
  2825. % there are optional.
  2826. \def\deftpparsebody #1#2#3#4 {\begingroup\inENV %
  2827. \medbreak %
  2828. % Define the end token that this defining construct specifies
  2829. % so that it will exit this group.
  2830. \def#1{\endgraf\endgroup\medbreak}%
  2831. \def#2##1 {\begingroup\obeylines\spacesplit{#3{##1}}}%
  2832. \parindent=0in
  2833. \advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
  2834. \exdentamount=\defbodyindent
  2835. \begingroup\obeylines\parsetpheaderline{#3{#4}}}
  2836.  
  2837. {\obeylines %
  2838.   % Parse the type name and any attributes (field names, etc.).
  2839.   % #1 is the beginning of the macro call that will produce the output,
  2840.   %   i.e., \deftpheader{CLASS}; this is passed from \deftpparsebody.
  2841.   % #2 is the type name, e.g., `struct termios'.
  2842.   % #3 is the (possibly empty) attribute list.
  2843.   % 
  2844.   \gdef\parsetpheaderline#1#2#3^^M{%
  2845.     \endgroup % Started in \deftpparsebody.
  2846.     %
  2847.     % If the attribute list is in fact empty, there will be no space after
  2848.     % #2; so we can't put a space in our TeX parameter list.  But if it
  2849.     % isn't empty, then #3 will begin with an unwanted space.
  2850.     \def\theargs{\ignorespaces #3}%
  2851.     %
  2852.     % Call the macro to produce the output.
  2853.     #1{#2}\theargs %
  2854.   }%
  2855. }
  2856.  
  2857. \def\defopvarparsebody #1#2#3#4#5 {\begingroup\inENV %
  2858. \medbreak %
  2859. % Define the end token that this defining construct specifies
  2860. % so that it will exit this group.
  2861. \def#1{\endgraf\endgroup\medbreak}%
  2862. \def#2##1 ##2 {\def#4{##1}%
  2863. \begingroup\obeylines\spacesplit{#3{##2}}}%
  2864. \parindent=0in
  2865. \advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindent
  2866. \exdentamount=\defbodyindent
  2867. \begingroup\obeylines\spacesplit{#3{#5}}}
  2868.  
  2869. % Split up #2 at the first space token.
  2870. % call #1 with two arguments:
  2871. %  the first is all of #2 before the space token,
  2872. %  the second is all of #2 after that space token.
  2873. % If #2 contains no space token, all of it is passed as the first arg
  2874. % and the second is passed as empty.
  2875.  
  2876. {\obeylines
  2877. \gdef\spacesplit#1#2^^M{\endgroup\spacesplitfoo{#1}#2 \relax\spacesplitfoo}%
  2878. \long\gdef\spacesplitfoo#1#2 #3#4\spacesplitfoo{%
  2879. \ifx\relax #3%
  2880. #1{#2}{}\else #1{#2}{#3#4}\fi}}
  2881.  
  2882. % So much for the things common to all kinds of definitions.
  2883.  
  2884. % Define @defun.
  2885.  
  2886. % First, define the processing that is wanted for arguments of \defun
  2887. % Use this to expand the args and terminate the paragraph they make up
  2888.  
  2889. \def\defunargs #1{\functionparens \sl
  2890. % Expand, preventing hyphenation at `-' chars.
  2891. % Note that groups don't affect changes in \hyphenchar.
  2892. \hyphenchar\tensl=0
  2893. #1%
  2894. \hyphenchar\tensl=45
  2895. \ifnum\parencount=0 \else \errmessage{unbalanced parens in @def arguments}\fi%
  2896. \interlinepenalty=10000
  2897. \advance\rightskip by 0pt plus 1fil
  2898. \endgraf\penalty 10000\vskip -\parskip\penalty 10000%
  2899. }
  2900.  
  2901. \def\deftypefunargs #1{%
  2902. % Expand, preventing hyphenation at `-' chars.
  2903. % Note that groups don't affect changes in \hyphenchar.
  2904. \functionparens
  2905. \code{#1}%
  2906. \interlinepenalty=10000
  2907. \advance\rightskip by 0pt plus 1fil
  2908. \endgraf\penalty 10000\vskip -\parskip\penalty 10000%
  2909. }
  2910.  
  2911. % Do complete processing of one @defun or @defunx line already parsed.
  2912.  
  2913. % @deffn Command forward-char nchars
  2914.  
  2915. \def\deffn{\defmethparsebody\Edeffn\deffnx\deffnheader}
  2916.  
  2917. \def\deffnheader #1#2#3{\doind {fn}{\code{#2}}%
  2918. \begingroup\defname {#2}{#1}\defunargs{#3}\endgroup %
  2919. \catcode 61=\other % Turn off change made in \defparsebody
  2920. }
  2921.  
  2922. % @defun == @deffn Function
  2923.  
  2924. \def\defun{\defparsebody\Edefun\defunx\defunheader}
  2925.  
  2926. \def\defunheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
  2927. \begingroup\defname {#1}{Function}%
  2928. \defunargs {#2}\endgroup %
  2929. \catcode 61=\other % Turn off change made in \defparsebody
  2930. }
  2931.  
  2932. % @deftypefun int foobar (int @var{foo}, float @var{bar})
  2933.  
  2934. \def\deftypefun{\defparsebody\Edeftypefun\deftypefunx\deftypefunheader}
  2935.  
  2936. % #1 is the data type.  #2 is the name and args.
  2937. \def\deftypefunheader #1#2{\deftypefunheaderx{#1}#2 \relax}
  2938. % #1 is the data type, #2 the name, #3 the args.
  2939. \def\deftypefunheaderx #1#2 #3\relax{%
  2940. \doind {fn}{\code{#2}}% Make entry in function index
  2941. \begingroup\defname {\code{#1} #2}{Function}%
  2942. \deftypefunargs {#3}\endgroup %
  2943. \catcode 61=\other % Turn off change made in \defparsebody
  2944. }
  2945.  
  2946. % @deftypefn {Library Function} int foobar (int @var{foo}, float @var{bar})
  2947.  
  2948. \def\deftypefn{\defmethparsebody\Edeftypefn\deftypefnx\deftypefnheader}
  2949.  
  2950. % #1 is the classification.  #2 is the data type.  #3 is the name and args.
  2951. \def\deftypefnheader #1#2#3{\deftypefnheaderx{#1}{#2}#3 \relax}
  2952. % #1 is the classification, #2 the data type, #3 the name, #4 the args.
  2953. \def\deftypefnheaderx #1#2#3 #4\relax{%
  2954. \doind {fn}{\code{#3}}% Make entry in function index
  2955. \begingroup\defname {\code{#2} #3}{#1}%
  2956. \deftypefunargs {#4}\endgroup %
  2957. \catcode 61=\other % Turn off change made in \defparsebody
  2958. }
  2959.  
  2960. % @defmac == @deffn Macro
  2961.  
  2962. \def\defmac{\defparsebody\Edefmac\defmacx\defmacheader}
  2963.  
  2964. \def\defmacheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
  2965. \begingroup\defname {#1}{Macro}%
  2966. \defunargs {#2}\endgroup %
  2967. \catcode 61=\other % Turn off change made in \defparsebody
  2968. }
  2969.  
  2970. % @defspec == @deffn Special Form
  2971.  
  2972. \def\defspec{\defparsebody\Edefspec\defspecx\defspecheader}
  2973.  
  2974. \def\defspecheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
  2975. \begingroup\defname {#1}{Special Form}%
  2976. \defunargs {#2}\endgroup %
  2977. \catcode 61=\other % Turn off change made in \defparsebody
  2978. }
  2979.  
  2980. % This definition is run if you use @defunx
  2981. % anywhere other than immediately after a @defun or @defunx.
  2982.  
  2983. \def\deffnx #1 {\errmessage{@deffnx in invalid context}}
  2984. \def\defunx #1 {\errmessage{@defunx in invalid context}}
  2985. \def\defmacx #1 {\errmessage{@defmacx in invalid context}}
  2986. \def\defspecx #1 {\errmessage{@defspecx in invalid context}}
  2987. \def\deftypefnx #1 {\errmessage{@deftypefnx in invalid context}}
  2988. \def\deftypeunx #1 {\errmessage{@deftypeunx in invalid context}}
  2989.  
  2990. % @defmethod, and so on
  2991.  
  2992. % @defop {Funny Method} foo-class frobnicate argument
  2993.  
  2994. \def\defop #1 {\def\defoptype{#1}%
  2995. \defopparsebody\Edefop\defopx\defopheader\defoptype}
  2996.  
  2997. \def\defopheader #1#2#3{%
  2998. \dosubind {fn}{\code{#2}}{on #1}% Make entry in function index
  2999. \begingroup\defname {#2}{\defoptype{} on #1}%
  3000. \defunargs {#3}\endgroup %
  3001. }
  3002.  
  3003. % @defmethod == @defop Method
  3004.  
  3005. \def\defmethod{\defmethparsebody\Edefmethod\defmethodx\defmethodheader}
  3006.  
  3007. \def\defmethodheader #1#2#3{%
  3008. \dosubind {fn}{\code{#2}}{on #1}% entry in function index
  3009. \begingroup\defname {#2}{Method on #1}%
  3010. \defunargs {#3}\endgroup %
  3011. }
  3012.  
  3013. % @defcv {Class Option} foo-class foo-flag
  3014.  
  3015. \def\defcv #1 {\def\defcvtype{#1}%
  3016. \defopvarparsebody\Edefcv\defcvx\defcvarheader\defcvtype}
  3017.  
  3018. \def\defcvarheader #1#2#3{%
  3019. \dosubind {vr}{\code{#2}}{of #1}% Make entry in var index
  3020. \begingroup\defname {#2}{\defcvtype{} of #1}%
  3021. \defvarargs {#3}\endgroup %
  3022. }
  3023.  
  3024. % @defivar == @defcv {Instance Variable}
  3025.  
  3026. \def\defivar{\defvrparsebody\Edefivar\defivarx\defivarheader}
  3027.  
  3028. \def\defivarheader #1#2#3{%
  3029. \dosubind {vr}{\code{#2}}{of #1}% Make entry in var index
  3030. \begingroup\defname {#2}{Instance Variable of #1}%
  3031. \defvarargs {#3}\endgroup %
  3032. }
  3033.  
  3034. % These definitions are run if you use @defmethodx, etc.,
  3035. % anywhere other than immediately after a @defmethod, etc.
  3036.  
  3037. \def\defopx #1 {\errmessage{@defopx in invalid context}}
  3038. \def\defmethodx #1 {\errmessage{@defmethodx in invalid context}}
  3039. \def\defcvx #1 {\errmessage{@defcvx in invalid context}}
  3040. \def\defivarx #1 {\errmessage{@defivarx in invalid context}}
  3041.  
  3042. % Now @defvar
  3043.  
  3044. % First, define the processing that is wanted for arguments of @defvar.
  3045. % This is actually simple: just print them in roman.
  3046. % This must expand the args and terminate the paragraph they make up
  3047. \def\defvarargs #1{\normalparens #1%
  3048. \interlinepenalty=10000
  3049. \endgraf\penalty 10000\vskip -\parskip\penalty 10000}
  3050.  
  3051. % @defvr Counter foo-count
  3052.  
  3053. \def\defvr{\defvrparsebody\Edefvr\defvrx\defvrheader}
  3054.  
  3055. \def\defvrheader #1#2#3{\doind {vr}{\code{#2}}%
  3056. \begingroup\defname {#2}{#1}\defvarargs{#3}\endgroup}
  3057.  
  3058. % @defvar == @defvr Variable
  3059.  
  3060. \def\defvar{\defvarparsebody\Edefvar\defvarx\defvarheader}
  3061.  
  3062. \def\defvarheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index
  3063. \begingroup\defname {#1}{Variable}%
  3064. \defvarargs {#2}\endgroup %
  3065. }
  3066.  
  3067. % @defopt == @defvr {User Option}
  3068.  
  3069. \def\defopt{\defvarparsebody\Edefopt\defoptx\defoptheader}
  3070.  
  3071. \def\defoptheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index
  3072. \begingroup\defname {#1}{User Option}%
  3073. \defvarargs {#2}\endgroup %
  3074. }
  3075.  
  3076. % @deftypevar int foobar
  3077.  
  3078. \def\deftypevar{\defvarparsebody\Edeftypevar\deftypevarx\deftypevarheader}
  3079.  
  3080. % #1 is the data type.  #2 is the name.
  3081. \def\deftypevarheader #1#2{%
  3082. \doind {vr}{\code{#2}}% Make entry in variables index
  3083. \begingroup\defname {\code{#1} #2}{Variable}%
  3084. \interlinepenalty=10000
  3085. \endgraf\penalty 10000\vskip -\parskip\penalty 10000
  3086. \endgroup}
  3087.  
  3088. % @deftypevr {Global Flag} int enable
  3089.  
  3090. \def\deftypevr{\defvrparsebody\Edeftypevr\deftypevrx\deftypevrheader}
  3091.  
  3092. \def\deftypevrheader #1#2#3{\doind {vr}{\code{#3}}%
  3093. \begingroup\defname {\code{#2} #3}{#1}
  3094. \interlinepenalty=10000
  3095. \endgraf\penalty 10000\vskip -\parskip\penalty 10000
  3096. \endgroup}
  3097.  
  3098. % This definition is run if you use @defvarx
  3099. % anywhere other than immediately after a @defvar or @defvarx.
  3100.  
  3101. \def\defvrx #1 {\errmessage{@defvrx in invalid context}}
  3102. \def\defvarx #1 {\errmessage{@defvarx in invalid context}}
  3103. \def\defoptx #1 {\errmessage{@defoptx in invalid context}}
  3104. \def\deftypevarx #1 {\errmessage{@deftypevarx in invalid context}}
  3105. \def\deftypevrx #1 {\errmessage{@deftypevrx in invalid context}}
  3106.  
  3107. % Now define @deftp
  3108. % Args are printed in bold, a slight difference from @defvar.
  3109.  
  3110. \def\deftpargs #1{\bf \defvarargs{#1}}
  3111.  
  3112. % @deftp Class window height width ...
  3113.  
  3114. \def\deftp{\deftpparsebody\Edeftp\deftpx\deftpheader}
  3115.  
  3116. \def\deftpheader #1#2#3{\doind {tp}{\code{#2}}%
  3117. \begingroup\defname {#2}{#1}\deftpargs{#3}\endgroup}
  3118.  
  3119. % This definition is run if you use @deftpx, etc
  3120. % anywhere other than immediately after a @deftp, etc.
  3121.  
  3122. \def\deftpx #1 {\errmessage{@deftpx in invalid context}}
  3123.  
  3124. \message{cross reference,}
  3125. % Define cross-reference macros
  3126. \newwrite \auxfile
  3127.  
  3128. \newif\ifhavexrefs  % True if xref values are known.
  3129. \newif\ifwarnedxrefs  % True if we warned once that they aren't known.
  3130.  
  3131. % \setref{foo} defines a cross-reference point named foo.
  3132.  
  3133. \def\setref#1{%
  3134. %\dosetq{#1-title}{Ytitle}%
  3135. \dosetq{#1-pg}{Ypagenumber}%
  3136. \dosetq{#1-snt}{Ysectionnumberandtype}}
  3137.  
  3138. \def\unnumbsetref#1{%
  3139. %\dosetq{#1-title}{Ytitle}%
  3140. \dosetq{#1-pg}{Ypagenumber}%
  3141. \dosetq{#1-snt}{Ynothing}}
  3142.  
  3143. \def\appendixsetref#1{%
  3144. %\dosetq{#1-title}{Ytitle}%
  3145. \dosetq{#1-pg}{Ypagenumber}%
  3146. \dosetq{#1-snt}{Yappendixletterandtype}}
  3147.  
  3148. % \xref, \pxref, and \ref generate cross-references to specified points.
  3149. % For \xrefX, #1 is the node name, #2 the name of the Info
  3150. % cross-reference, #3 the printed node name, #4 the name of the Info
  3151. % file, #5 the name of the printed manual.  All but the node name can be
  3152. % omitted.
  3153. \def\pxref#1{see \xrefX[#1,,,,,,,]}
  3154. \def\xref#1{See \xrefX[#1,,,,,,,]}
  3155. \def\ref#1{\xrefX[#1,,,,,,,]}
  3156. \def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup%
  3157. \def\printedmanual{\ignorespaces #5}%
  3158. \def\printednodename{\ignorespaces #3}%
  3159. %
  3160. \setbox1=\hbox{\printedmanual}%
  3161. \setbox0=\hbox{\printednodename}%
  3162. \ifdim \wd0=0pt%
  3163. \def\printednodename{\ignorespaces #1}%
  3164. %%% Uncommment the following line to make the actual chapter or section title
  3165. %%% appear inside the square brackets.
  3166. %\def\printednodename{#1-title}%
  3167. \fi%
  3168. %
  3169. %
  3170. % If we use \unhbox0 and \unhbox1 to print the node names, TeX does
  3171. % not insert empty discretionaries after hyphens, which means that it
  3172. % will not find a line break at a hyphen in a node names.  Since some
  3173. % manuals are best written with fairly long node names, containing
  3174. % hyphens, this is a loss.  Therefore, we simply give the text of
  3175. % the node name again, so it is as if TeX is seeing it for the first
  3176. % time.
  3177. \ifdim \wd1>0pt
  3178. section ``\printednodename'' in \cite{\printedmanual}%
  3179. \else%
  3180. \turnoffactive%
  3181. \refx{#1-snt}{} [\printednodename], page\tie\refx{#1-pg}{}%
  3182. \fi
  3183. \endgroup}
  3184.  
  3185. % \dosetq is the interface for calls from other macros
  3186.  
  3187. % Use \turnoffactive so that punctuation chars such as underscore
  3188. % work in node names.
  3189. \def\dosetq #1#2{{\let\folio=0 \turnoffactive%
  3190. \edef\next{\write\auxfile{\internalsetq {#1}{#2}}}%
  3191. \next}}
  3192.  
  3193. % \internalsetq {foo}{page} expands into
  3194. % CHARACTERS 'xrdef {foo}{...expansion of \Ypage...}
  3195. % When the aux file is read, ' is the escape character
  3196.  
  3197. \def\internalsetq #1#2{'xrdef {#1}{\csname #2\endcsname}}
  3198.  
  3199. % Things to be expanded by \internalsetq
  3200.  
  3201. \def\Ypagenumber{\folio}
  3202.  
  3203. \def\Ytitle{\thischapter}
  3204.  
  3205. \def\Ynothing{}
  3206.  
  3207. \def\Ysectionnumberandtype{%
  3208. \ifnum\secno=0 Chapter\xreftie\the\chapno %
  3209. \else \ifnum \subsecno=0 Section\xreftie\the\chapno.\the\secno %
  3210. \else \ifnum \subsubsecno=0 %
  3211. Section\xreftie\the\chapno.\the\secno.\the\subsecno %
  3212. \else %
  3213. Section\xreftie\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno %
  3214. \fi \fi \fi }
  3215.  
  3216. \def\Yappendixletterandtype{%
  3217. \ifnum\secno=0 Appendix\xreftie'char\the\appendixno{}%
  3218. \else \ifnum \subsecno=0 Section\xreftie'char\the\appendixno.\the\secno %
  3219. \else \ifnum \subsubsecno=0 %
  3220. Section\xreftie'char\the\appendixno.\the\secno.\the\subsecno %
  3221. \else %
  3222. Section\xreftie'char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno %
  3223. \fi \fi \fi }
  3224.  
  3225. \gdef\xreftie{'tie}
  3226.  
  3227. % Use TeX 3.0's \inputlineno to get the line number, for better error
  3228. % messages, but if we're using an old version of TeX, don't do anything.
  3229. \ifx\inputlineno\thisisundefined
  3230.   \let\linenumber = \empty % Non-3.0.
  3231. \else
  3232.   \def\linenumber{\the\inputlineno:\space}
  3233. \fi
  3234.  
  3235. % Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME.
  3236. % If its value is nonempty, SUFFIX is output afterward.
  3237.  
  3238. \def\refx#1#2{%
  3239.   \expandafter\ifx\csname X#1\endcsname\relax
  3240.     % If not defined, say something at least.
  3241.     $\langle$un\-de\-fined$\rangle$%
  3242.     \ifhavexrefs
  3243.       \message{\linenumber Undefined cross reference `#1'.}%
  3244.     \else
  3245.       \ifwarnedxrefs\else
  3246.         \global\warnedxrefstrue
  3247.         \message{Cross reference values unknown; you must run TeX again.}%
  3248.       \fi
  3249.     \fi
  3250.   \else
  3251.     % It's defined, so just use it.
  3252.     \csname X#1\endcsname
  3253.   \fi
  3254.   #2% Output the suffix in any case.
  3255. }
  3256.  
  3257. % Read the last existing aux file, if any.  No error if none exists.
  3258.  
  3259. % This is the macro invoked by entries in the aux file.
  3260. \def\xrdef #1#2{
  3261. {\catcode`\'=\other\expandafter \gdef \csname X#1\endcsname {#2}}}
  3262.  
  3263. \def\readauxfile{%
  3264. \begingroup
  3265. \catcode `\^^@=\other
  3266. \catcode `\⇧=\other
  3267. \catcode `\⇩=\other
  3268. \catcode `\^^C=\other
  3269. \catcode `\^^D=\other
  3270. \catcode `\^^E=\other
  3271. \catcode `\^^F=\other
  3272. \catcode `\^^G=\other
  3273. \catcode `\^^H=\other
  3274. \catcode `\♪=\other
  3275. \catcode `\^^L=\other
  3276. \catcode `\=\other
  3277. \catcode `\=\other
  3278. \catcode `\⓪=\other
  3279. \catcode `\①=\other
  3280. \catcode `\②=\other
  3281. \catcode `\③=\other
  3282. \catcode `\④=\other
  3283. \catcode `\⑤=\other
  3284. \catcode `\⑥=\other
  3285. \catcode `\⑦=\other
  3286. \catcode `\⑧=\other
  3287. \catcode `\⑨=\other
  3288. \catcode 26=\other
  3289. \catcode `\^^[=\other
  3290. \catcode `\^^\=\other
  3291. \catcode `\^^]=\other
  3292. \catcode `\^^^=\other
  3293. \catcode `\^^_=\other
  3294. \catcode `\@=\other
  3295. \catcode `\^=\other
  3296. \catcode `\~=\other
  3297. \catcode `\[=\other
  3298. \catcode `\]=\other
  3299. \catcode`\"=\other
  3300. \catcode`\_=\other
  3301. \catcode`\|=\other
  3302. \catcode`\<=\other
  3303. \catcode`\>=\other
  3304. \catcode `\$=\other
  3305. \catcode `\#=\other
  3306. \catcode `\&=\other
  3307. % `\+ does not work, so use 43.
  3308. \catcode 43=\other
  3309. % the aux file uses ' as the escape.
  3310. % Turn off \ as an escape so we do not lose on
  3311. % entries which were dumped with control sequences in their names.
  3312. % For example, 'xrdef {$\leq $-fun}{page ...} made by @defun ^^
  3313. % Reference to such entries still does not work the way one would wish,
  3314. % but at least they do not bomb out when the aux file is read in.
  3315. \catcode `\{=1 \catcode `\}=2
  3316. \catcode `\%=\other
  3317. \catcode `\'=0
  3318. \catcode `\\=\other
  3319. \openin 1 \jobname.aux
  3320. \ifeof 1 \else \closein 1 \input \jobname.aux \global\havexrefstrue
  3321. \fi
  3322. % Open the new aux file.  Tex will close it automatically at exit.
  3323. \openout \auxfile=\jobname.aux
  3324. \endgroup}
  3325.  
  3326.  
  3327. % Footnotes.
  3328.  
  3329. \newcount \footnoteno
  3330.  
  3331. % The trailing space in the following definition for supereject is
  3332. % vital for proper filling; pages come out unaligned when you do a
  3333. % pagealignmacro call if that space before the closing brace is
  3334. % removed.
  3335. \def\supereject{\par\penalty -20000\footnoteno =0 }
  3336.  
  3337. % @footnotestyle is meaningful for info output only..
  3338. \let\footnotestyle=\comment
  3339.  
  3340. \let\ptexfootnote=\footnote
  3341.  
  3342. {\catcode `\@=11
  3343. \long\gdef\footnote #1{\global\advance \footnoteno by \@ne
  3344. \unskip
  3345. \edef\thisfootno{$^{\the\footnoteno}$}%
  3346. \let\@sf\empty
  3347. \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\/\fi
  3348. \thisfootno\@sf \footnotezzz{#1}}
  3349. % \parsearg\footnotezzz}
  3350.  
  3351. \long\gdef\footnotezzz #1{\insert\footins{
  3352. \interlinepenalty\interfootnotelinepenalty
  3353. \splittopskip\ht\strutbox % top baseline for broken footnotes
  3354. \splitmaxdepth\dp\strutbox \floatingpenalty\@MM
  3355. \leftskip\z@skip \rightskip\z@skip \spaceskip\z@skip \xspaceskip\z@skip
  3356. \footstrut\parindent=\defaultparindent\hang\textindent{\thisfootno}#1\strut}}
  3357.  
  3358. }%end \catcode `\@=11
  3359.  
  3360. % Set the baselineskip to #1, and the lineskip and strut size
  3361. % correspondingly.  There is no deep meaning behind these magic numbers
  3362. % used as factors; they just match (closely enough) what Knuth defined.
  3363. \def\lineskipfactor{.1}
  3364. \def\strutheightpercent{.71}
  3365. \def\strutdepthpercent{.29}
  3366. %
  3367. \def\setleading#1{%
  3368.   \baselineskip = #1\relax
  3369.   \normalbaselineskip = \baselineskip
  3370.   \lineskip = \lineskipfactor\baselineskip
  3371.   \setbox\strutbox =\hbox{%
  3372.     \vrule width0pt height\strutheightpercent\baselineskip
  3373.                     depth \strutdepthpercent \baselineskip
  3374.   }%
  3375. }
  3376.  
  3377. % @| inserts a changebar to the left of the current line.  It should
  3378. % surround any changed text.  This approach does *not* work if the
  3379. % change spans more than two lines of output.  To handle that, we would
  3380. % have adopt a much more difficult approach (putting marks into the main
  3381. % vertical list for the beginning and end of each change).
  3382. \def\|{%
  3383.   % \vadjust can only be used in horizontal mode.
  3384.   \leavevmode
  3385.   %
  3386.   % Append this vertical mode material after the current line in the output.
  3387.   \vadjust{%
  3388.     % We want to insert a rule with the height and depth of the current
  3389.     % leading; that is exactly what \strutbox is supposed to record.
  3390.     \vskip-\baselineskip
  3391.     %
  3392.     % \vadjust-items are inserted at the left edge of the type.  So
  3393.     % the \llap here moves out into the left-hand margin.
  3394.     \llap{%
  3395.       %
  3396.       % For a thicker or thinner bar, change the `1pt'.
  3397.       \vrule height\baselineskip width1pt
  3398.       %
  3399.       % This is the space between the bar and the text.
  3400.       \hskip 12pt
  3401.     }%
  3402.   }%
  3403. }
  3404.  
  3405. % For a final copy, take out the rectangles
  3406. % that mark overfull boxes (in case you have decided
  3407. % that the text looks ok even though it passes the margin).
  3408. \def\finalout{\overfullrule=0pt}
  3409.  
  3410.  
  3411. % End of control word definitions.
  3412.  
  3413. \message{and turning on texinfo input format.}
  3414.  
  3415. \def\openindices{%
  3416.    \newindex{cp}%
  3417.    \newcodeindex{fn}%
  3418.    \newcodeindex{vr}%
  3419.    \newcodeindex{tp}%
  3420.    \newcodeindex{ky}%
  3421.    \newcodeindex{pg}%
  3422. }
  3423.  
  3424. % Set some numeric style parameters, for 8.5 x 11 format.
  3425.  
  3426. %\hsize = 6.5in
  3427. \newdimen\defaultparindent \defaultparindent = 15pt
  3428. \parindent = \defaultparindent
  3429. \parskip 18pt plus 1pt
  3430. \setleading{15pt}
  3431. \advance\topskip by 1.2cm
  3432.  
  3433. % Prevent underfull vbox error messages.
  3434. \vbadness=10000
  3435.  
  3436. % Following George Bush, just get rid of widows and orphans.
  3437. \widowpenalty=10000
  3438. \clubpenalty=10000
  3439.  
  3440. % Use TeX 3.0's \emergencystretch to help line breaking, but if we're
  3441. % using an old version of TeX, don't do anything.  We want the amount of
  3442. % stretch added to depend on the line length, hence the dependence on
  3443. % \hsize.  This makes it come to about 9pt for the 8.5x11 format.
  3444. \ifx\emergencystretch\thisisundefined \else
  3445.   \emergencystretch = \hsize
  3446.   \divide\emergencystretch by 45
  3447. \fi
  3448.  
  3449. % Use @smallbook to reset parameters for 7x9.5 format  (or else 7x9.25)
  3450. \def\smallbook{
  3451.  
  3452. % These values for secheadingskip and subsecheadingskip are
  3453. % experiments.  RJC 7 Aug 1992
  3454. \global\secheadingskip = 17pt plus 6pt minus 3pt
  3455. \global\subsecheadingskip = 14pt plus 6pt minus 3pt
  3456.  
  3457. \global\lispnarrowing = 0.3in
  3458. \setleading{12pt}
  3459. \advance\topskip by -1cm
  3460. \global\parskip 3pt plus 1pt
  3461. \global\hsize = 5in
  3462. \global\vsize=7.5in
  3463. \global\tolerance=700
  3464. \global\hfuzz=1pt
  3465. \global\contentsrightmargin=0pt
  3466.  
  3467. \global\pagewidth=\hsize
  3468. \global\pageheight=\vsize
  3469.  
  3470. \global\let\smalllisp=\smalllispx
  3471. \global\let\smallexample=\smalllispx
  3472. \global\def\Esmallexample{\Esmalllisp}
  3473. }
  3474.  
  3475. % Use @afourpaper to print on European A4 paper.
  3476. \def\afourpaper{
  3477. \global\tolerance=700
  3478. \global\hfuzz=1pt
  3479. \setleading{12pt}
  3480. \global\parskip 15pt plus 1pt
  3481.  
  3482. \global\vsize= 53\baselineskip
  3483. \advance\vsize by \topskip
  3484. %\global\hsize=   5.85in     % A4 wide 10pt
  3485. \global\hsize=  6.5in
  3486. \global\outerhsize=\hsize
  3487. \global\advance\outerhsize by 0.5in
  3488. \global\outervsize=\vsize
  3489. \global\advance\outervsize by 0.6in
  3490.  
  3491. \global\pagewidth=\hsize
  3492. \global\pageheight=\vsize
  3493. }
  3494.  
  3495. % Define macros to output various characters with catcode for normal text.
  3496. \catcode`\"=\other
  3497. \catcode`\~=\other
  3498. \catcode`\^=\other
  3499. \catcode`\_=\other
  3500. \catcode`\|=\other
  3501. \catcode`\<=\other
  3502. \catcode`\>=\other
  3503. \catcode`\+=\other
  3504. \def\normaldoublequote{"}
  3505. \def\normaltilde{~}
  3506. \def\normalcaret{^}
  3507. \def\normalunderscore{_}
  3508. \def\normalverticalbar{|}
  3509. \def\normalless{<}
  3510. \def\normalgreater{>}
  3511. \def\normalplus{+}
  3512.  
  3513. % This macro is used to make a character print one way in ttfont
  3514. % where it can probably just be output, and another way in other fonts,
  3515. % where something hairier probably needs to be done.
  3516. %
  3517. % #1 is what to print if we are indeed using \tt; #2 is what to print
  3518. % otherwise.  Since all the Computer Modern typewriter fonts have zero
  3519. % interword stretch (and shrink), and it is reasonable to expect all
  3520. % typewriter fonts to have this, we can check that font parameter.
  3521. \def\ifusingtt#1#2{\ifdim \fontdimen3\the\font=0pt #1\else #2\fi}
  3522.  
  3523. % Turn off all special characters except @
  3524. % (and those which the user can use as if they were ordinary).
  3525. % Most of these we simply print from the \tt font, but for some, we can
  3526. % use math or other variants that look better in normal text.
  3527.  
  3528. \catcode`\"=\active
  3529. \def\activedoublequote{{\tt \char '042}}
  3530. \let"=\activedoublequote
  3531. \catcode`\~=\active
  3532. \def~{{\tt \char '176}}
  3533. \chardef\hat=`\^
  3534. \catcode`\^=\active
  3535. \def^{{\tt \hat}}
  3536.  
  3537. \catcode`\_=\active
  3538. \def_{\ifusingtt\normalunderscore\_}
  3539. % Subroutine for the previous macro.
  3540. \def\_{\lvvmode \kern.06em \vbox{\hrule width.3em height.1ex}}
  3541.  
  3542. % \lvvmode is equivalent in function to \leavevmode.
  3543. % Using \leavevmode runs into trouble when written out to
  3544. % an index file due to the expansion of \leavevmode into ``\unhbox
  3545. % \voidb@x'' ---which looks to TeX like ``\unhbox \voidb\x'' due to our
  3546. % magic tricks with @.
  3547. \def\lvvmode{\vbox to 0pt{}}
  3548.  
  3549. \catcode`\|=\active
  3550. \def|{{\tt \char '174}}
  3551. \chardef \less=`\<
  3552. \catcode`\<=\active
  3553. \def<{{\tt \less}}
  3554. \chardef \gtr=`\>
  3555. \catcode`\>=\active
  3556. \def>{{\tt \gtr}}
  3557. \catcode`\+=\active
  3558. \def+{{\tt \char 43}}
  3559. %\catcode 27=\active
  3560. %\def^^[{$\diamondsuit$}
  3561.  
  3562. % Used sometimes to turn off (effectively) the active characters
  3563. % even after parsing them.
  3564. \def\turnoffactive{\let"=\normaldoublequote
  3565. \let~=\normaltilde
  3566. \let^=\normalcaret
  3567. \let_=\normalunderscore
  3568. \let|=\normalverticalbar
  3569. \let<=\normalless
  3570. \let>=\normalgreater
  3571. \let+=\normalplus}
  3572.  
  3573. % Set up an active definition for =, but don't enable it most of the time.
  3574. {\catcode`\==\active
  3575. \global\def={{\tt \char 61}}}
  3576.  
  3577. \catcode`\@=0
  3578.  
  3579. % \rawbackslashxx output one backslash character in current font
  3580. \global\chardef\rawbackslashxx=`\\
  3581. %{\catcode`\\=\other
  3582. %@gdef@rawbackslashxx{\}}
  3583.  
  3584. % \rawbackslash redefines \ as input to do \rawbackslashxx.
  3585. {\catcode`\\=\active
  3586. @gdef@rawbackslash{@let\=@rawbackslashxx }}
  3587.  
  3588. % \normalbackslash outputs one backslash in fixed width font.
  3589. \def\normalbackslash{{\tt\rawbackslashxx}}
  3590.  
  3591. % Say @foo, not \foo, in error messages.
  3592. \escapechar=`\@
  3593.  
  3594. % \catcode 17=0   % Define control-q
  3595. \catcode`\\=\active
  3596.  
  3597. % If a .fmt file is being used, we don't want the `\input texinfo' to show up.
  3598. % That is what \eatinput is for; after that, the `\' should revert to printing 
  3599. % a backslash.
  3600. %
  3601. @gdef@eatinput input texinfo{@fixbackslash}
  3602. @global@let\ = @eatinput
  3603.  
  3604. % On the other hand, perhaps the file did not have a `\input texinfo'. Then
  3605. % the first `\{ in the file would cause an error. This macro tries to fix 
  3606. % that, assuming it is called before the first `\' could plausibly occur.
  3607. @gdef@fixbackslash{@ifx\@eatinput @let\ = @normalbackslash @fi}
  3608.  
  3609. %% These look ok in all fonts, so just make them not special.  The @rm below
  3610. %% makes sure that the current font starts out as the newly loaded cmr10
  3611. @catcode`@$=@other @catcode`@%=@other @catcode`@&=@other @catcode`@#=@other
  3612.  
  3613. @textfonts
  3614. @rm
  3615.  
  3616. @c Local variables:
  3617. @c page-delimiter: "^\\\\message"
  3618. @c End:
  3619.